update asterisk 1.2.x to 1.2.24, cleanup
[openwrt/svn-archive/archive.git] / net / asterisk / files / asterisk.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3 START=50
4
5 DEFAULT=/etc/default/asterisk
6 DEST=
7 OPTIONS=
8
9 start() {
10 [ -f $DEFAULT ] && . $DEFAULT
11 mkdir -p $DEST/var/run
12 mkdir -p $DEST/var/log/asterisk
13 mkdir -p $DEST/var/spool/asterisk
14 [ -f $DEST/usr/lib/asterisk/astdb ] && mv $DEST/usr/lib/asterisk/astdb $DEST/var/spool/asterisk/
15 [ -h $DEST/usr/lib/asterisk/astdb ] || ln -sf $DEST/var/spool/asterisk/astdb $DEST/usr/lib/asterisk/
16 /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 }