freeswitch/build/modcheck.sh

37 lines
756 B
Bash
Raw Normal View History

2014-02-21 21:42:41 +00:00
#!/bin/sh
PATH=$PATH:/bin:/usr/bin
mods=$1
on=''
off=''
2014-02-21 21:42:41 +00:00
if [ -z $mods ] ; then
mods="/usr/local/freeswitch/mod"
fi
echo "Checking module integrity in target [$mods]"
echo
here=`pwd`
cd $mods
files=`ls *.so 2>/dev/null`
2014-02-21 21:42:41 +00:00
cd $here
for i in $files ; do
mod=${i%%.*}
infile=`grep ^.*$mod\$ ../modules.conf | grep -v ftmod_`
commented=`grep ^\#.*$mod\$ ../modules.conf | grep -v ftmod_`
2014-02-21 21:42:41 +00:00
if [ -z "$infile" ] ; then
echo "${on}WARNING: installed module: $i was not installed by this build. It is not present in modules.conf.${off}"
2014-02-21 21:42:41 +00:00
elif [ -n "$commented" ] ; then
echo "${on}WARNING: installed module: $i was not installed by this build. It is commented from modules.conf. [$commented]${off}"
2014-02-21 21:42:41 +00:00
fi
done
echo