mirror of
https://git.freebsd.org/ports.git
synced 2025-07-11 22:39:16 -04:00
Newport: net/yate Yate is a telephony engine aimed at creating a telephony server that performs well enough to deal with PBX requirements and also flexible enough for complex Gateway and IVR solutions. WWW: http://YATE.null.ro/ PR: ports/114814 Submitted by: Balwinder S Dheeman <bdheeman@hotmail.com>
45 lines
832 B
Bash
45 lines
832 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: yate
|
|
# REQUIRE: DAEMON
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Add the following lines to /etc/rc.conf to enable the YATE:
|
|
#
|
|
# yate_enable="YES"
|
|
#
|
|
|
|
. %%RC_SUBR%%
|
|
|
|
name=yate
|
|
rcvar=`set_rcvar`
|
|
|
|
command="%%PREFIX%%/sbin/yate"
|
|
pidfile="/var/run/${name}.pid"
|
|
logfile="/var/log/yate/messages"
|
|
cdrfile=`awk -F= '/^file=.+/ {print $2}' %%PREFIX%%/etc/yate/cdrfile.conf`
|
|
|
|
start_precmd="yate_prestart"
|
|
stop_postcmd="yate_poststop"
|
|
|
|
yate_prestart()
|
|
{
|
|
mkdir -p $(dirname $pidfile)
|
|
chown yate:yate $(dirname $pidfile)
|
|
mkdir -p $(dirname $cdrfile)
|
|
chown yate:yate $(dirname $cdrfile)
|
|
chown yate:yate $(dirname $logfile)
|
|
}
|
|
|
|
yate_poststop()
|
|
{
|
|
rm -f $pidfile
|
|
}
|
|
|
|
yate_enable=${yate_enable="NO"}
|
|
yate_flags=${yate_flags-"-Du -d -l ${logfile} -p ${pidfile} -s"}
|
|
|
|
load_rc_config ${name}
|
|
run_rc_command "$1"
|