modcheck.sh 756 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. PATH=$PATH:/bin:/usr/bin
  3. mods=$1
  4. on=''
  5. off=''
  6. if [ -z $mods ] ; then
  7. mods="/usr/local/freeswitch/mod"
  8. fi
  9. echo "Checking module integrity in target [$mods]"
  10. echo
  11. here=`pwd`
  12. cd $mods
  13. files=`ls *.so 2>/dev/null`
  14. cd $here
  15. for i in $files ; do
  16. mod=${i%%.*}
  17. infile=`grep ^.*$mod\$ ../modules.conf | grep -v ftmod_`
  18. commented=`grep ^\#.*$mod\$ ../modules.conf | grep -v ftmod_`
  19. if [ -z "$infile" ] ; then
  20. echo "${on}WARNING: installed module: $i was not installed by this build. It is not present in modules.conf.${off}"
  21. elif [ -n "$commented" ] ; then
  22. echo "${on}WARNING: installed module: $i was not installed by this build. It is commented from modules.conf. [$commented]${off}"
  23. fi
  24. done
  25. echo