2009-01-31 15:37:14 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
# Copyright (C) 2008 OpenWrt.org
|
|
|
|
START=50
|
|
|
|
|
|
|
|
DEST=
|
|
|
|
DEFAULT=$DEST/etc/default/asterisk
|
|
|
|
OPTIONS=""
|
|
|
|
|
|
|
|
start() {
|
|
|
|
[ -f $DEFAULT ] && . $DEFAULT
|
2010-03-30 23:32:02 +00:00
|
|
|
[ -d $DEST/var/run/asterisk ] || mkdir -p $DEST/var/run/asterisk
|
2009-01-31 15:37:14 +00:00
|
|
|
[ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk
|
|
|
|
[ -d $DEST/var/spool/asterisk ] || mkdir -p $DEST/var/spool/asterisk
|
|
|
|
[ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk
|
|
|
|
[ -h $DEST/usr/lib/asterisk/astdb ] || ln -sf /var/spool/asterisk/astdb $DEST/usr/lib/asterisk/astdb
|
|
|
|
$DEST/usr/sbin/asterisk $OPTIONS
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2010-03-30 23:32:02 +00:00
|
|
|
[ -f $DEST/var/run/asterisk/asterisk.pid ] && kill $(cat $DEST/var/run/asterisk/asterisk.pid) >/dev/null 2>&1
|
2009-01-31 15:37:14 +00:00
|
|
|
}
|