fusionpbx-install.sh/freebsd/resources/switch/rc.d.freeswitch

32 lines
915 B
Bash
Executable File

#!/bin/sh
#
# PROVIDE: freeswitch
# REQUIRE: LOGIN cleanvar
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable freeswitch:
# freeswitch_enable: Set it to "YES" to enable freeswitch.
# Default is "NO".
# freeswitch_flags: Flags passed to freeswitch-script on startup.
# Default is "".
#
. /etc/rc.subr
name="freeswitch"
rcvar=${name}_enable
load_rc_config $name
: ${freeswitch_enable="NO"}
: ${freeswitch_username:=www}
: ${freeswitch_groupname:=www}
: ${freeswitch_pidfile="/var/run/freeswitch/freeswitch.pid"}
start_cmd=${name}_start
stop_cmd=${name}_stop
status_cmd=${name}_status
pidfile=${freeswitch_pidfile}
freeswitch_start() {
/usr/local/bin/freeswitch -nc -u ${freeswitch_username} -g ${freeswitch_groupname} ${freeswitch_flags}
}
freeswitch_stop() {
/usr/local/bin/freeswitch -stop
}
run_rc_command "$1"