From 4e13324684839d4dfbe97ff2b7023d07ac6dc4a5 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 1 Apr 2008 13:08:42 -0400 Subject: Run as a NetworkManagerDispatcher script (#439242) --- NetworkManager/dispatcher.d/05-netfs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 NetworkManager/dispatcher.d/05-netfs 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 + -- cgit v1.2.1