forked from signalwire/freeswitch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodcheck.sh
36 lines (25 loc) · 778 Bytes
/
modcheck.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
PATH=$PATH:/bin:/usr/bin
mods=$1
on='[01;00;35m'
off='[0m'
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`
cd $here
for i in $files ; do
mod=${i%%.*}
infile=`grep -E "^.*$mod(\|.*)?$" ../modules.conf | grep -v ftmod_`
commented=`grep -E "^\#.*$mod(\|.*)?$" ../modules.conf | grep -v ftmod_`
if [ -z "$infile" ] ; then
echo "${on}WARNING: installed module: $i was not installed by this build. It is not present in modules.conf.${off}"
elif [ -n "$commented" ] ; then
echo "${on}WARNING: installed module: $i was not installed by this build. It is commented from modules.conf. [$commented]${off}"
fi
done
echo