2001-01-07 20:04:49 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2001-04-26 07:54:38 +04:00
|
|
|
# $NetBSD: isdnd,v 1.4 2001/04/26 03:54:38 lukem Exp $
|
2001-01-07 20:04:49 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: isdnd
|
|
|
|
# REQUIRE: NETWORK syslogd mountcritremote
|
2001-04-26 07:54:38 +04:00
|
|
|
#
|
|
|
|
# Note that this means that syslogd will not be listening on
|
|
|
|
# any isdn addresses. This is considered a feature.
|
|
|
|
#
|
2001-01-07 20:04:49 +03:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="isdnd"
|
|
|
|
rcvar=$name
|
|
|
|
required_files="/etc/isdn/${name}.rc"
|
|
|
|
|
|
|
|
command="/usr/sbin/${name}"
|
|
|
|
pidfile="/var/run/${name}.pid"
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|
|
|
|
|
2001-01-08 15:45:39 +03:00
|
|
|
if checkyesno isdnd && checkyesno isdn_autoupdown; then
|
2001-01-07 20:53:36 +03:00
|
|
|
|
|
|
|
# The isdn network interfaces could not be marked UP in the
|
|
|
|
# ifconfig.* files, since the daemon wasn't available then.
|
|
|
|
# If we are doing start: now it's running, so figure which
|
|
|
|
# interfaces these applies to and UP them. If doing stop:
|
|
|
|
# down them (for symetry, and effectively they are down).
|
|
|
|
|
|
|
|
case "$_arg" in
|
2001-04-26 07:54:38 +04:00
|
|
|
start)
|
2001-01-07 20:53:36 +03:00
|
|
|
ifflag="-d"
|
|
|
|
ifcmd="up"
|
|
|
|
;;
|
2001-04-26 07:54:38 +04:00
|
|
|
stop)
|
2001-01-07 20:53:36 +03:00
|
|
|
ifflag="-u"
|
|
|
|
ifcmd="down"
|
|
|
|
;;
|
2001-04-26 07:54:38 +04:00
|
|
|
*)
|
2001-01-07 20:53:36 +03:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2001-01-08 15:45:39 +03:00
|
|
|
if [ -z "$isdn_interfaces" ]; then
|
|
|
|
# the user has not specified a list of interface
|
|
|
|
# to track isdnd - try to figure ourselfs
|
|
|
|
tmp=`ifconfig -l $ifflag`
|
|
|
|
for int in $tmp; do
|
|
|
|
# Check if the interface has been configured at all
|
|
|
|
# XXX - does this work with IPv6 ?
|
|
|
|
if ifconfig $int | fgrep inet >/dev/null; then
|
|
|
|
case $int in
|
|
|
|
isp*)
|
|
|
|
isdn_interfaces="$isdn_interfaces $int"
|
|
|
|
;;
|
|
|
|
ipr*)
|
|
|
|
isdn_interfaces="$isdn_interfaces $int"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
for int in $isdn_interfaces; do
|
|
|
|
ifconfig $int $ifcmd
|
2001-01-07 20:53:36 +03:00
|
|
|
done
|
|
|
|
fi
|