From 1e8cbaca0a8813263a2d1ad03a778dd84a80616a Mon Sep 17 00:00:00 2001 From: "Michael K. Johnson" Date: Mon, 20 Apr 1998 20:36:57 +0000 Subject: Made some sense of the "network status" command. Integrate with linuxconf (works with or without). --- rc.d/init.d/network | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/network b/rc.d/init.d/network index 247f3c1c..02b9d39f 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -29,7 +29,9 @@ cd /etc/sysconfig/network-scripts # find all the interfaces besides loopback. # ignore aliases, alternative configurations, and editor backup files -interfaces=`ls ifcfg* | egrep -v '(ifcfg-lo|:)' | egrep 'ifcfg-[a-z0-9]+$'` +interfaces=`ls ifcfg* | egrep -v '(ifcfg-lo|:)' | egrep 'ifcfg-[a-z0-9]+$' | \ + sed 's/^ifcfg-//g'` + # See how we were called. case "$1" in @@ -76,14 +78,42 @@ case "$1" in rm -f /var/lock/subsys/network ;; status) - status network + echo "Configured devices:" + echo lo $interfaces + + if [ -x /bin/linuxconf ] ; then + eval `/bin/linuxconf --hint netdev` + echo "Devices that are down:" + echo $DEV_UP + echo "Devices with modified configuration:" + echo $DEV_RECONF + else + echo "Currently active devices:" + echo `/sbin/ifconfig | grep ^[a-z] | awk '{print $1}'` + fi ;; restart) $0 stop $0 start ;; + reload) + if [ -x /bin/linuxconf ] ; then + eval `/bin/linuxconf --hint netdev` + for device in $DEV_UP ; do + ./ifup $device boot + done + for device in $DEV_DOWN ; do + ./ifdown $device boot + done + for device in $DEV_RECONF ; do + ./ifdown $device boot + ./ifup $device boot + done + else + $0 restart + fi *) - echo "Usage: network {start|stop|restart|status}" + echo "Usage: network {start|stop|restart|reload|status}" exit 1 esac -- cgit v1.2.1