mirror of
https://git.freebsd.org/ports.git
synced 2025-07-11 22:39:16 -04:00
- Make the "sofia recover" only run if you've set freeswitch_cluster so it doesn't break the ability to start the daemon [1] - Bump PORTREVISION - Mark MAKE_JOBS_UNSAFE due to failures building it with FORCE_MAKE_JOBS PR: ports/175305 [1] Submitted by: Mark Felder <feld@feld.me> [1]
52 lines
1,021 B
Bash
52 lines
1,021 B
Bash
#!/bin/sh
|
|
|
|
# PROVIDE: freeswitch
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Add the following lines to /etc/rc.conf to enable freeswitch:
|
|
#
|
|
# freeswitch_enable="YES"
|
|
#
|
|
#
|
|
# freeswitch_user="freeswitch"
|
|
# freeswitch_group="freeswitch"
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=freeswitch
|
|
rcvar=`set_rcvar`
|
|
|
|
load_rc_config $name
|
|
|
|
: ${freeswitch_enable=NO}
|
|
: ${freeswitch_cluster=NO}
|
|
: ${freeswitch_user=freeswitch}
|
|
: ${freeswitch_group=freeswitch}
|
|
: ${freeswitch_flags=-nc -waste}
|
|
|
|
command=%%PREFIX%%/bin/freeswitch
|
|
command_args="-u ${freeswitch_user} -g ${freeswitch_group}"
|
|
|
|
umask 002
|
|
|
|
pidfile=${freeswitch_pidfile:-"/var/run/freeswitch/freeswitch.pid"}
|
|
|
|
start_precmd="${name}_prestart"
|
|
stop_cmd="${name}_stop"
|
|
|
|
freeswitch_stop () {
|
|
echo "Stopping FreeSWITCH."
|
|
%%PREFIX%%/bin/freeswitch -stop
|
|
wait_for_pids `cat $pidfile`
|
|
}
|
|
|
|
freeswitch_prestart () {
|
|
install -d -o ${freeswitch_user} -m755 /var/run/${name}
|
|
|
|
if checkyesno freeswitch_cluster; then
|
|
%%PREFIX%%/bin/fs_cli -x "sofia recover"
|
|
fi
|
|
}
|
|
|
|
run_rc_command "$1"
|