forked from SimplesIP/pabx-app
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
1.5 KiB
92 lines
1.5 KiB
#!/bin/bash |
|
# |
|
# /etc/init.d/Daemon |
|
# |
|
# Starts the at daemon |
|
# |
|
# Adicionando o serviço a inicilizacao. |
|
# chkconfig --add supervisor |
|
# chkconfig --level 345 supervisor on |
|
# description: Serviço para troca de dados referentes aos agentes e supervisores. |
|
# processname: ssupervisor |
|
|
|
|
|
# Source function library. |
|
. /etc/init.d/functions |
|
|
|
#startup values |
|
log=/var/log/superivisor.log |
|
|
|
#verify that the executable exists |
|
#test -x /var/www/html/Asterisk/var_lib_asterisk/scripts/supervisor/ssupervisor.php || exit 0RETVAL=0 |
|
test -x /var/lib/asterisk/scripts/supervisor/ssupervisor.php || exit 0RETVAL=0 |
|
|
|
# |
|
# Set prog, proc and bin variables. |
|
# |
|
prog="superivisor" |
|
proc=/var/lock/subsys/superivisor |
|
#bin=/var/www/html/Asterisk/var_lib_asterisk/scripts/supervisor/ssupervisor.php |
|
bin=/var/lib/asterisk/scripts/supervisor/ssupervisor.php |
|
|
|
start() { |
|
# Check if Daemon is already running |
|
if [ ! -f $proc ]; then |
|
echo -n $"Starting $prog: " |
|
daemon $bin --log=$log |
|
RETVAL=$? |
|
[ $RETVAL -eq 0 ] && touch $proc |
|
echo |
|
fi |
|
|
|
return $RETVAL |
|
} |
|
|
|
stop() { |
|
echo -n $"Stopping $prog: " |
|
killproc $bin |
|
RETVAL=$? |
|
[ $RETVAL -eq 0 ] && rm -f $proc |
|
echo |
|
return $RETVAL |
|
} |
|
|
|
restart() { |
|
stop |
|
start |
|
} |
|
|
|
reload() { |
|
restart |
|
} |
|
|
|
status_at() { |
|
status $bin |
|
} |
|
|
|
case "$1" in |
|
start) |
|
start |
|
;; |
|
stop) |
|
stop |
|
;; |
|
reload|restart) |
|
restart |
|
;; |
|
condrestart) |
|
if [ -f $proc ]; then |
|
restart |
|
fi |
|
;; |
|
status) |
|
status_at |
|
;; |
|
*) |
|
|
|
echo $"Usage: $0 {start|stop|restart|condrestart|status}" |
|
exit 1 |
|
esac |
|
|
|
exit $? |
|
exit $RETVAL |