luka 04e0c705d4 [packages] asterisk-11.x: add new package
LTS version of Asterisk has been recently released. This package is a
bleeding-edge alternative to existing asterisk-1.8.x package.

Signed-off-by: Jiri Slachta <slachta@cesnet.cz>
Signed-off-by: Daniel Golle <dgolle@allnet.de>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@35540 3c298f89-4303-0410-b956-a3cf2f4a3e73
2013-02-10 17:17:09 +00:00

36 lines
1016 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2013 OpenWrt.org
. /lib/functions/service.sh
START=99
APP=asterisk
OPTIONS=
DEST=
DEFAULT=$DEST/etc/default/$APP
BIN_FILE=$DEST/usr/sbin/$APP
PID_FILE=$DEST/var/run/$APP/$APP.pid
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 $DEST/var/lib ] || mkdir -p $DEST/var/lib
[ -h $DEST/var/lib/asterisk ] || ln -s /usr/lib/asterisk /var/lib/asterisk
[ -d $DEST/var/lib/asterisk/keys ] || mkdir -p $DEST/var/lib/asterisk/keys
SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid" \
service_start $BIN_FILE $OPTIONS
}
stop() {
SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid" \
service_stop $BIN_FILE
}
reload() {
SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid" \
service_reload $BIN_FILE
}