Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc Add startup script for isdnd.



details:   https://anonhg.NetBSD.org/src/rev/56243222a425
branches:  trunk
changeset: 501795:56243222a425
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jan 07 17:04:49 2001 +0000

description:
Add startup script for isdnd.

diffstat:

 etc/defaults/rc.conf |   5 +++-
 etc/rc.d/isdnd       |  54 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+), 1 deletions(-)

diffs (77 lines):

diff -r b25ce41b7a51 -r 56243222a425 etc/defaults/rc.conf
--- a/etc/defaults/rc.conf      Sun Jan 07 17:01:53 2001 +0000
+++ b/etc/defaults/rc.conf      Sun Jan 07 17:04:49 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: rc.conf,v 1.4 2001/01/03 17:54:04 itojun Exp $
+#      $NetBSD: rc.conf,v 1.5 2001/01/07 17:04:49 martin Exp $
 #
 # /etc/defaults/rc.conf --
 #      default configuration of /etc/rc.conf
@@ -163,6 +163,9 @@
 # Heimdal Kerberos 5 KDC (with Kerberos IV compatibility)
 kdc=NO                 kdc_flags=""
 
+# ISDN daemon
+isdnd=NO               isdnd_flags=""
+
 # Other daemons.
 #
 rwhod=NO
diff -r b25ce41b7a51 -r 56243222a425 etc/rc.d/isdnd
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/rc.d/isdnd    Sun Jan 07 17:04:49 2001 +0000
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# $NetBSD: isdnd,v 1.1 2001/01/07 17:04:50 martin Exp $
+#
+
+# PROVIDE: isdnd
+# REQUIRE: NETWORK syslogd mountcritremote
+
+. /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"
+
+# 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
+  start)
+       ifflag="-d"
+       ifcmd="up"
+       ;;
+  stop)
+       ifflag="-u"
+       ifcmd="down"
+       ;;
+  *)
+       exit 0
+       ;;
+esac
+
+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*)
+                       ifconfig $int $ifcmd
+                       ;;
+               ipr*)
+                       ifconfig $int $ifcmd
+                       ;;
+               esac
+       fi
+done



Home | Main Index | Thread Index | Old Index