binutils: update to 2.43.1
[openadk.git] / package / asterisk / files / asterisk.init
blob9f3e2aa5ce266ae66f2ae655173e01dd2f977084
1 #!/bin/sh
2 #PKG asterisk
3 #INIT 60
4 . /etc/rc.conf
6 case $1 in
7 autostop) ;;
8 autostart)
9 test x"${asterisk:-NO}" = x"NO" && exit 0
10 test x"$asterisk" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
11 exec sh $0 start
13 start)
14 for dir in run log spool lib keys; do
15 [ -d /var/$dir/asterisk ] || mkdir -p /var/$dir/asterisk
16 done
17 /usr/sbin/asterisk
19 stop)
20 [ -f /var/run/asterisk/asterisk.pid ] && \
21 kill $(cat /var/run/asterisk/asterisk.pid) >/dev/null 2>&1
23 restart)
24 sh $0 stop
25 sh $0 start
28 echo "usage: $0 {start | stop | restart}"
29 exit 1
31 esac
32 exit $?