florian a69799bebd [packages] add asterisk-1.8.x, patch from zandbelt
git-svn-id: svn://svn.openwrt.org/openwrt/packages@25545 3c298f89-4303-0410-b956-a3cf2f4a3e73
2011-02-15 10:18:49 +00:00

22 lines
700 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2008 OpenWrt.org
START=50
DEST=
DEFAULT=$DEST/etc/default/asterisk
OPTIONS=""
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 /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() {
[ -f $DEST/var/run/asterisk/asterisk.pid ] && kill $(cat $DEST/var/run/asterisk/asterisk.pid) >/dev/null 2>&1
}