aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflo <flo@FreeBSD.org>2011-01-04 22:19:53 +0800
committerflo <flo@FreeBSD.org>2011-01-04 22:19:53 +0800
commit0854951f783008e90a6174460140c899e1ff326e (patch)
tree692da3c789664ca79791c6b6ecb7831ad5cb5c5b
parent651821ef63061879d2d1bf49c291d6f8fc9f4c6f (diff)
downloadfreebsd-ports-gnome-0854951f783008e90a6174460140c899e1ff326e.tar.gz
freebsd-ports-gnome-0854951f783008e90a6174460140c899e1ff326e.tar.zst
freebsd-ports-gnome-0854951f783008e90a6174460140c899e1ff326e.zip
- add reload target
- general cleanup - add $FreeBSD$ IDs PR: ports/152703 Submitted by: Alexander Brovikov <alexander@brovikov.ru> Reviewed by: dougb Approved by: jadawin (mentor)
-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"