36 lines
1016 B
Plaintext
36 lines
1016 B
Plaintext
|
#!/bin/sh /etc/rc.common
|
||
|
# Copyright (C) 2013 OpenWrt.org
|
||
|
|
||
|
. /lib/functions/service.sh
|
||
|
|
||
|
START=99
|
||
|
APP=asterisk
|
||
|
OPTIONS=
|
||
|
DEST=
|
||
|
DEFAULT=$DEST/etc/default/$APP
|
||
|
BIN_FILE=$DEST/usr/sbin/$APP
|
||
|
PID_FILE=$DEST/var/run/$APP/$APP.pid
|
||
|
|
||
|
start() {
|
||
|
[ -f $DEFAULT ] && . $DEFAULT
|
||
|
[ -d $DEST/var/run/asterisk ] || mkdir -p $DEST/var/run/asterisk
|
||
|
[ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk
|
||
|
[ -d $DEST/var/spool/asterisk ] || mkdir -p $DEST/var/spool/asterisk
|
||
|
[ -d $DEST/var/lib ] || mkdir -p $DEST/var/lib
|
||
|
[ -h $DEST/var/lib/asterisk ] || ln -s /usr/lib/asterisk /var/lib/asterisk
|
||
|
[ -d $DEST/var/lib/asterisk/keys ] || mkdir -p $DEST/var/lib/asterisk/keys
|
||
|
|
||
|
SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid" \
|
||
|
service_start $BIN_FILE $OPTIONS
|
||
|
}
|
||
|
|
||
|
stop() {
|
||
|
SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid" \
|
||
|
service_stop $BIN_FILE
|
||
|
}
|
||
|
|
||
|
reload() {
|
||
|
SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid" \
|
||
|
service_reload $BIN_FILE
|
||
|
}
|