#!/bin/sh # PROVIDE: freeswitch # REQUIRE: DAEMON # KEYWORD: FreeBSD . %%RC_SUBR%% name=freeswitch rcvar=`set_rcvar` command=%%PREFIX%%/freeswitch/bin/freeswitch command_args="-nc" pidfile=${freeswitch_pidfile:-"%%PREFIX%%/freeswitch/log/freeswitch.pid"} freeswitch_enable=${freeswitch_enable-"YES"} start_cmd="freeswitch_start" stop_precmd="freeswitch_stop" restart_cmd="freeswitch_restart" sig_stop=KILL load_rc_config $name freeswitch_stop () { echo "Stopping Freeswitch." %%PREFIX%%/freeswitch/bin/freeswitch -stop sleep 1 return 0 } freeswitch_start () { echo "Starting FreeSwitch." /usr/sbin/daemon -f /bin/sh -c "$command" sleep 1 return } freeswitch_restart () { echo "ReStarting FreeSwitch." freeswitch_stop freeswitch_start sleep 1 return } run_rc_command "$1"