Blob Blame History Raw
#!/bin/sh

export LC_ALL=C

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

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