starticzrpbx 302 B

12345678910111213141516
  1. #! /usr/bin/env bash
  2. set -eu
  3. pidfile=/var/run/asterisk/asterisk.pid
  4. command=/usr/sbin/fwconsole
  5. function kill_app(){
  6. $command stop
  7. exit $?
  8. }
  9. trap "kill_app" SIGINT SIGTERM
  10. $command chown
  11. $command start -q
  12. sleep 2
  13. while [ -f $pidfile ] && kill -0 $(cat $pidfile) ; do
  14. sleep 5
  15. done
  16. exit 1000