freebsd-ports/misc/dahdi-kmod26/files/dahdi.in
Max Khon 2bb716e083 DAHDI 2.6.1 development version:
- Digium TE820: PCI-Express eight-port T1/E1/J1 is now supported
- new FreeBSD compat shims (similar to OFED in FreeBSD 9 and later)
- wcb1xxp support (temporarily) removed - it was not working in 2.4 port anyway
- dahdi_dynamic is likely to be broken
2012-08-29 11:54:28 +00:00

80 lines
1.3 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: dahdi
# REQUIRE: NETWORKING
# KEYWORD: shutdown
# BEFORE: asterisk
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# dahdi_enable (bool): YES/NO (default: NO)
# dahdi_modules (list of strings): dahdi modules to load at boot (default: dahdi)
#
# Valid modules are:
# - dahdi
# - dahdi_transcode
# - wcb4xxp
# - wcfxo
# - wct4xxp
# - wctc4xxp
# - wctdm
# - wctdm24xxp
# - wcte11xp
# - wcte12xp
#
# Example:
#
# dahdi_enable="YES"
# dahdi_modules="wct4xxp"
#
. /etc/rc.subr
name="dahdi"
rcvar=dahdi_enable
start_cmd="dahdi_start"
stop_cmd="dahdi_stop"
load_rc_config $name
: ${dahdi_enable="NO"}
: ${dahdi_modules="dahdi"}
kmod_dir=%%PREFIX%%/lib/dahdi
# reverse list
for m in ${dahdi_modules}; do
dahdi_modules_unload="$m ${dahdi_modules_unload}"
done
dahdi_start()
{
echo "Starting ${name}."
# load kernel modules
kldconfig -mf ${kmod_dir}
for m in ${dahdi_modules}; do
kldload $m || exit 1
done
# configure devfs
devfs rule apply path 'dahdi/*' mode 0664 user root group dahdi
# run configuration utilities
%%PREFIX%%/sbin/dahdi_cfg
if [ -r %%PREFIX%%/etc/fxotune.conf ]; then
echo "Starting fxotune."
%%PREFIX%%/sbin/fxotune -s
fi
}
dahdi_stop()
{
echo -n " ${name}"
for m in ${dahdi_modules_unload}; do
kldunload $m
done
}
run_rc_command "$1"