aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoliy Guskov <anatoliy.guskov@gmail.com>2008-04-01 20:15:47 +0000
committerAnatoliy Guskov <anatoliy.guskov@gmail.com>2008-04-01 20:15:47 +0000
commit6c3a74187bbf171879d661cb4aef4855a6e1a780 (patch)
tree0428e01e789e1058dad13e421b00527b1b36320f
parent28449ed320a5db88453b4cbd767ecae5b7934fdc (diff)
parente3a871a31826536fa3cb52b70fed1e7e4b9c6c30 (diff)
downloadinitscripts-6c3a74187bbf171879d661cb4aef4855a6e1a780.tar
initscripts-6c3a74187bbf171879d661cb4aef4855a6e1a780.tar.gz
initscripts-6c3a74187bbf171879d661cb4aef4855a6e1a780.tar.bz2
initscripts-6c3a74187bbf171879d661cb4aef4855a6e1a780.tar.xz
initscripts-6c3a74187bbf171879d661cb4aef4855a6e1a780.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/initscripts
-rwxr-xr-xNetworkManager/dispatcher.d/05-netfs17
-rwxr-xr-xrc.d/init.d/netfs2
-rwxr-xr-xsysconfig/network-scripts/ifup-eth7
3 files changed, 22 insertions, 4 deletions
diff --git a/NetworkManager/dispatcher.d/05-netfs b/NetworkManager/dispatcher.d/05-netfs
new file mode 100755
index 00000000..b3ba12c7
--- /dev/null
+++ b/NetworkManager/dispatcher.d/05-netfs
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+export LC_ALL=C
+
+if [ "$2" = "down" ]; then
+ ip route ls | grep -q ^default || {
+ [ -f /var/lock/subsys/netfs ] && /etc/rc.d/init.d/netfs stop
+ }
+fi
+
+if [ "$2" = "up" ]; then
+ defdev=$(ip route ls | awk '/^default/ { print $NF }')
+ if [ "$defdev" = "$1" ]; then
+ /sbin/chkconfig netfs && /etc/rc.d/init.d/netfs start
+ fi
+fi
+
diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs
index cfe9264c..6769c132 100755
--- a/rc.d/init.d/netfs
+++ b/rc.d/init.d/netfs
@@ -10,7 +10,7 @@
# description: Mounts and unmounts all Network File System (NFS), \
# SMB/CIFS (Lan Manager/Windows), and NCP (NetWare) mount points.
### BEGIN INIT INFO
-# Provides: $local_fs $remote_fs
+# Provides: $remote_fs
### END INIT INFO
[ -f /etc/sysconfig/network ] || exit 0
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index 3e2c1d47..c5d03576 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -117,9 +117,10 @@ fi
# slave device?
if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" ]; then
- /sbin/ip link set dev ${DEVICE} down
- echo "+${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null
-
+ grep -wq "${DEVICE}" /sys/class/net/${MASTER}/bonding/slaves || {
+ /sbin/ip link set dev ${DEVICE} down
+ echo "+${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null
+ }
if [ -n "$ETHTOOL_OPTS" ] ; then
/sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
fi