add basic asterisk 1.6.x package based on 1.6.1-rc1
[openwrt/svn-archive/archive.git] / net / asterisk-1.6.x / files / asterisk.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2008 OpenWrt.org
3 START=50
4
5 DEST=
6 DEFAULT=$DEST/etc/default/asterisk
7 OPTIONS=""
8
9 start() {
10 [ -f $DEFAULT ] && . $DEFAULT
11 [ -d $DEST/var/run ] || mkdir -p $DEST/var/run
12 [ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk
13 [ -d $DEST/var/spool/asterisk ] || mkdir -p $DEST/var/spool/asterisk
14 [ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk
15 [ -h $DEST/usr/lib/asterisk/astdb ] || ln -sf /var/spool/asterisk/astdb $DEST/usr/lib/asterisk/astdb
16 $DEST/usr/sbin/asterisk $OPTIONS
17 }
18
19 stop() {
20 [ -f $DEST/var/run/asterisk.pid ] && kill $(cat $DEST/var/run/asterisk.pid) >/dev/null 2>&1
21 }