1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-01 01:17:02 +00:00

Allow list of modules to be loaded at startup to be configured via

zaptel_kmod_load rc.conf variable.

PR:		ports/115739
Submitted by:	Adam Jacob Muller <adam@adam.gs>
This commit is contained in:
Maxim Sobolev 2008-08-15 18:48:56 +00:00
parent ef6631cab1
commit 371c080feb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=218646
2 changed files with 15 additions and 8 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= zaptel PORTNAME= zaptel
PORTVERSION= 1.4.6 PORTVERSION= 1.4.6
PORTREVISION= 6 PORTREVISION= 7
CATEGORIES= misc kld CATEGORIES= misc kld
MASTER_SITES= http://www.pbxpress.com/~gonzo/ MASTER_SITES= http://www.pbxpress.com/~gonzo/
DISTNAME= ${PORTNAME}-bsd-${PORTVERSION} DISTNAME= ${PORTNAME}-bsd-${PORTVERSION}

View File

@ -18,18 +18,28 @@
kmod_dir=%%PREFIX%%/lib/zaptel 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" name="zaptel"
rcvar=${name}_enable rcvar=${name}_enable
start_cmd="zaptel_start" start_cmd="zaptel_start"
stop_cmd="zaptel_stop" stop_cmd="zaptel_stop"
load_rc_config $name
: ${zaptel_enable="NO"}
: ${zaptel_kmod_load="zaptel.ko qozap.ko tau32pci.ko wcfxo.ko wcfxs.ko wct1xxp.ko wct4xxp.ko wcte11xp.ko wcte12xp.ko"}
# Reverse list
zaptel_kmod_unload=""
for kmod in ${zaptel_kmod_load}
do
zaptel_kmod_unload="${kmod} ${zaptel_kmod_unload}"
done
zaptel_start() zaptel_start()
{ {
echo -n " ${name}" echo -n " ${name}"
for kmod in ${kmod_load} for kmod in ${zaptel_kmod_load}
do do
if [ -e ${kmod_dir}/${kmod} ] if [ -e ${kmod_dir}/${kmod} ]
then then
@ -42,7 +52,7 @@ zaptel_start()
zaptel_stop() zaptel_stop()
{ {
echo -n " ${name}" echo -n " ${name}"
for kmod in ${kmod_unload} for kmod in ${zaptel_kmod_unload}
do do
if [ -e ${kmod_dir}/${kmod} ] if [ -e ${kmod_dir}/${kmod} ]
then then
@ -50,8 +60,5 @@ zaptel_stop()
fi fi
done done
} }
load_rc_config $name
: ${zaptel_enable="NO"}
run_rc_command "$1" run_rc_command "$1"