freebsd-ports/misc/zaptel/files/zaptel.in
Maxim Sobolev 3122d1afe6 Update to 1.4.6.
Submitted by:	Oleksandr Tymoshenko
2007-07-22 08:58:36 +00:00

57 lines
1 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: zaptel
# REQUIRE: NETWORKING
# KEYWORD: shutdown
# BEFORE: asterisk
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# zaptel_enable (bool): Set to NO by default.
# Set it to YES to enable zaptel.
#
. %%RC_SUBR%%
kmod_dir=%%PREFIX%%/lib/zaptel
kmod_load="zaptel.ko qozap.ko tau32pci.ko wcfxo.ko wcfxs.ko wct1xxp.ko wct4xxp.ko wcte11xp.ko wcte12xp.ko"
kmod_unload="wcte12xp.ko wcte11xp.ko wct4xxp.ko wct1xxp.ko wcfxs.ko wcfxo.ko tau32pci.ko qozap.ko zaptel.ko"
name="zaptel"
rcvar=${name}_enable
start_cmd="zaptel_start"
stop_cmd="zaptel_stop"
zaptel_start()
{
echo -n " ${name}"
for kmod in ${kmod_load}
do
if [ -e ${kmod_dir}/${kmod} ]
then
kldload ${kmod_dir}/${kmod} || exit 1
fi
done
%%PREFIX%%/bin/ztcfg
}
zaptel_stop()
{
echo -n " ${name}"
for kmod in ${kmod_unload}
do
if [ -e ${kmod_dir}/${kmod} ]
then
kldunload ${kmod}
fi
done
}
load_rc_config $name
: ${zaptel_enable="NO"}
run_rc_command "$1"