aboutsummaryrefslogtreecommitdiff
path: root/net/asterisk16
diff options
context:
space:
mode:
authorFlorian Smeets <flo@FreeBSD.org>2011-01-04 14:19:53 +0000
committerFlorian Smeets <flo@FreeBSD.org>2011-01-04 14:19:53 +0000
commit797f0ccdc99909c0933d7f8ad9827d50844bc4ec (patch)
treee495fd3b1c56ebcfcf1c080570009573d5275b57 /net/asterisk16
parented643170300537eeb69a344b0e362ccdca1f4cd7 (diff)
downloadports-797f0ccdc99909c0933d7f8ad9827d50844bc4ec.tar.gz
ports-797f0ccdc99909c0933d7f8ad9827d50844bc4ec.zip
Notes
Diffstat (limited to 'net/asterisk16')
-rw-r--r--net/asterisk16/files/asterisk.sh.in31
1 files changed, 20 insertions, 11 deletions
diff --git a/net/asterisk16/files/asterisk.sh.in b/net/asterisk16/files/asterisk.sh.in
index 4d10717d64ae..949852163145 100644
--- a/net/asterisk16/files/asterisk.sh.in
+++ b/net/asterisk16/files/asterisk.sh.in
@@ -1,4 +1,7 @@
#!/bin/sh
+#
+# $FreeBSD$
+#
# PROVIDE: asterisk
# REQUIRE: LOGIN
@@ -11,24 +14,30 @@
. /etc/rc.subr
-stop_cmd=asterisk_shutdown
-asterisk_shutdown () {
- echo 'Stopping asterisk'
- %%PREFIX%%/sbin/asterisk -nqrx 'core stop now'
- sleep 1
- return 0
-}
-
name=asterisk
rcvar=`set_rcvar`
-command=%%PREFIX%%/sbin/asterisk
-command_args="-n -U %%ASTERISK_USER%%"
+extra_commands="reload"
-load_rc_config $name
+stop_cmd="asterisk_stop"
+reload_cmd="asterisk_reload"
+command="%%PREFIX%%/sbin/asterisk"
+command_args="-n -U %%ASTERISK_USER%%"
pidfile=${asterisk_pidfile:-"/var/run/asterisk.pid"}
+asterisk_stop() {
+ echo 'Stopping asterisk'
+ $command -nqrx 'core stop now'
+}
+
+asterisk_reload() {
+ echo 'Reloading asterisk'
+ $command -nqrx 'reload'
+}
+
+load_rc_config $name
+
asterisk_enable=${asterisk_enable:-"NO"}
run_rc_command "$1"