diff options
author | Doug Barton <dougb@FreeBSD.org> | 2012-08-05 23:19:36 +0000 |
---|---|---|
committer | Doug Barton <dougb@FreeBSD.org> | 2012-08-05 23:19:36 +0000 |
commit | 9aac569eaa031e27191a3f4165b389a17f467ad2 (patch) | |
tree | 1ed78841e1757014ccc09581c61c3683992d3f77 /net/asterisk16/files/asterisk.in | |
parent | When installing in the base, USE_RCORDER does the right thing without (diff) |
Move the rc.d scripts of the form *.sh.in to *.in
Where necessary add $FreeBSD$ to the file
No PORTREVISION bump necessary because this is a no-op
Diffstat (limited to 'net/asterisk16/files/asterisk.in')
-rw-r--r-- | net/asterisk16/files/asterisk.in | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/net/asterisk16/files/asterisk.in b/net/asterisk16/files/asterisk.in new file mode 100644 index 000000000000..be2d32d87d6c --- /dev/null +++ b/net/asterisk16/files/asterisk.in @@ -0,0 +1,43 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: asterisk +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable asterisk: +# +# asterisk_enable="YES" +# + +. /etc/rc.subr + +name=asterisk +rcvar=asterisk_enable + +extra_commands="reload" + +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" |