aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael K. Johnson <johnsonm@redhat.com>1998-04-20 20:36:57 +0000
committerMichael K. Johnson <johnsonm@redhat.com>1998-04-20 20:36:57 +0000
commit1e8cbaca0a8813263a2d1ad03a778dd84a80616a (patch)
treec8e348e03e748ae8c78f5a59c1b5edc59a997cca
parent5e2f2add9e7e1fcdb351d7f03fb96210db173e9f (diff)
downloadinitscripts-1e8cbaca0a8813263a2d1ad03a778dd84a80616a.tar
initscripts-1e8cbaca0a8813263a2d1ad03a778dd84a80616a.tar.gz
initscripts-1e8cbaca0a8813263a2d1ad03a778dd84a80616a.tar.bz2
initscripts-1e8cbaca0a8813263a2d1ad03a778dd84a80616a.tar.xz
initscripts-1e8cbaca0a8813263a2d1ad03a778dd84a80616a.zip
Made some sense of the "network status" command.
Integrate with linuxconf (works with or without).
-rwxr-xr-xrc.d/init.d/network36
1 files changed, 33 insertions, 3 deletions
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