diff options
author | nico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2005-06-03 07:21:53 +0000 |
---|---|---|
committer | nico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2005-06-03 07:21:53 +0000 |
commit | d5422dbf9528f1b596da011899265412d56a42ec (patch) | |
tree | 3da10f2a17684dde75168a9fb33e9e3979feb837 /openwrt/package/asterisk/files/asterisk.init | |
parent | d30532602bad83e534dfff39bdf9918b62c4396d (diff) |
Standardize initscript
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@1140 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'openwrt/package/asterisk/files/asterisk.init')
-rw-r--r-- | openwrt/package/asterisk/files/asterisk.init | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/openwrt/package/asterisk/files/asterisk.init b/openwrt/package/asterisk/files/asterisk.init new file mode 100644 index 000000000..698c3dfa8 --- /dev/null +++ b/openwrt/package/asterisk/files/asterisk.init @@ -0,0 +1,23 @@ +#!/bin/sh + +DEFAULT=/etc/default/asterisk +OPTIONS="" +[ -f $DEFAULT ] && . $DEFAULT +[ "$ENABLE_ASTERISK" = "yes" ] || exit 0 + +case $1 in + start) + [ -d /var/run ] || mkdir -p /var/run + [ -d /var/log/asterisk ] || mkdir -p /var/log/asterisk + [ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk + /usr/sbin/asterisk $OPTIONS + ;; + stop) + [ -f /var/run/asterisk.pid ] && kill $(cat /var/run/asterisk.pid) >/dev/null 2>&1 + ;; + *) + echo "usage: $0 (start|stop)" + exit 1 +esac + +exit $? |