2
0

healthcheck.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. #
  3. # FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
  4. # Copyright (C) 2005-2016, Anthony Minessale II <anthm@freeswitch.org>
  5. #
  6. # Version: MPL 1.1
  7. #
  8. # The contents of this file are subject to the Mozilla Public License Version
  9. # 1.1 (the "License"); you may not use this file except in compliance with
  10. # the License. You may obtain a copy of the License at
  11. # http://www.mozilla.org/MPL/F
  12. #
  13. # Software distributed under the License is distributed on an "AS IS" basis,
  14. # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  15. # for the specific language governing rights and limitations under the
  16. # License.
  17. #
  18. # The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
  19. #
  20. # The Initial Developer of the Original Code is
  21. # Michael Jerris <mike@jerris.com>
  22. # Portions created by the Initial Developer are Copyright (C)
  23. # the Initial Developer. All Rights Reserved.
  24. #
  25. # Contributor(s):
  26. #
  27. # Sergey Safarov <s.safarov@gmail.com>
  28. #
  29. # Check FreeSwitch status
  30. fs_cli -x status | grep -q ^UP || exit 1
  31. # Check erlang related modules is registered on epmd daemon
  32. KAZOO_EXIST=$(fs_cli -x "module_exists mod_kazoo")
  33. ERLANG_EXITS=$(fs_cli -x "module_exists mod_erlang_event")
  34. if [ "$KAZOO_EXIST" == "true" -o "$ERLANG_EXITS" == "true" ]; then
  35. /usr/bin/epmd -names | grep -qE "^name freeswitch at port" || exit 1
  36. fi
  37. exit 0