2010-11-28 19:33:57 +00:00
|
|
|
#!/bin/sh
|
2011-01-04 14:17:02 +00:00
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
2010-11-28 19:33:57 +00:00
|
|
|
|
|
|
|
# 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
|
2012-01-14 08:57:23 +00:00
|
|
|
rcvar=asterisk_enable
|
2010-11-28 19:33:57 +00:00
|
|
|
|
2011-01-04 14:17:02 +00:00
|
|
|
extra_commands="reload"
|
|
|
|
|
|
|
|
stop_cmd="asterisk_stop"
|
|
|
|
reload_cmd="asterisk_reload"
|
|
|
|
|
|
|
|
command="%%PREFIX%%/sbin/asterisk"
|
2013-04-22 21:11:34 +00:00
|
|
|
command_args="-n -F -U %%ASTERISK_USER%%"
|
2011-01-04 14:17:02 +00:00
|
|
|
pidfile=${asterisk_pidfile:-"/var/run/asterisk/asterisk.pid"}
|
2010-11-28 19:33:57 +00:00
|
|
|
|
2011-01-04 14:17:02 +00:00
|
|
|
asterisk_stop() {
|
|
|
|
echo 'Stopping asterisk'
|
|
|
|
$command -nqrx 'core stop now'
|
|
|
|
}
|
2010-11-28 19:33:57 +00:00
|
|
|
|
2011-01-04 14:17:02 +00:00
|
|
|
asterisk_reload() {
|
|
|
|
echo 'Reloading asterisk'
|
|
|
|
$command -nqrx 'reload'
|
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
2010-11-28 19:33:57 +00:00
|
|
|
|
|
|
|
asterisk_enable=${asterisk_enable:-"NO"}
|
|
|
|
|
|
|
|
run_rc_command "$1"
|