require.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Copyright (C) 2017 Mikko Lehto
  2. # Copyright (C) 2008 1&1 Internet AG
  3. #
  4. # This file is part of kamailio, a free SIP server.
  5. #
  6. # kamailio is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version
  10. #
  11. # kamailio is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. . include/common
  20. check_kamailio() {
  21. if ! (test -e $BIN) ; then
  22. echo "kamailio not found, not run"
  23. return 1
  24. fi;
  25. return 0
  26. }
  27. check_module() {
  28. if [ $# -ne 1 ]; then
  29. echo "wrong number of params in check_module()"
  30. return 1
  31. fi
  32. if ! (test -e $SRC_DIR/modules/$1/$1.so) ; then
  33. echo "$SRC_DIR/modules/$1/$1.so not found, not run"
  34. return 1
  35. fi;
  36. return 0
  37. }
  38. check_netcat() {
  39. if ! ( which nc > /dev/null ); then
  40. echo "netcat not found, not run"
  41. return 1
  42. fi;
  43. return 0
  44. }
  45. check_sipp() {
  46. if ! ( which sipp > /dev/null ); then
  47. echo "sipp not found, not run"
  48. return 1
  49. fi;
  50. return 0
  51. }
  52. check_sipsak() {
  53. if ! ( which sipsak > /dev/null ); then
  54. echo "sipsak not found, not run"
  55. return 1
  56. fi;
  57. return 0
  58. }