Blob Blame Raw
#!/bin/sh

export LC_ALL=C

if [ "$2" = "down" ]; then
	/sbin/ip route ls | grep -q ^default || {
		[ -f /var/lock/subsys/iscsi ] && /etc/rc.d/init.d/iscsi stop
	}
fi

if [ "$2" = "up" ]; then
	/sbin/ip -o route show dev "$1" | grep -q '^default' && {
		/sbin/chkconfig iscsi && /etc/rc.d/init.d/iscsi start
	}
fi