Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # lines 136 to 167 of /etc/rc.d/rc.network
- # http://www.pearltrees.com/s243a/testinterface-puppylinux/id16440735
- # cutdown version of this function (can't just source net-setup.sh...)
- testInterface()
- {
- #INTERFACE="$1"
- echo -n "cheching if interface $INTERFACE is alive..."
- #sleep 1 # rerwin's original solution
- # no, move the sleep 1 so is only used for wireless
- #091108 old ifplugstatus now -0.18, latest is just 'ifplugstatus'...
- IFPLUGOLD=ifplugstatus
- IFPLUGNEW=ifplugstatus
- [ -x /sbin/ifplugstatus-0.18 ] && IFPLUGOLD=ifplugstatus-0.18
- [ -x /sbin/ifplugstatus-0.25 ] && IFPLUGNEW=ifplugstatus-0.25
- if ! $IFPLUGOLD "$INTERFACE" | grep -F -q 'link beat detected' ;then
- sleep 1
- if ! $IFPLUGNEW "$INTERFACE" | grep -F -q 'link beat detected' ;then
- sleep 2
- if ! $IFPLUGOLD "$INTERFACE" | grep -F -q 'link beat detected' ;then
- sleep 2
- if ! $IFPLUGNEW "$INTERFACE" | grep -F -q 'link beat detected' ;then
- # add ethtool test, just in case it helps at times...
- sleep 1
- if ! ethtool "$INTERFACE" | grep -Fq 'Link detected: yes' ; then
- echo "no"
- return 1
- fi
- fi
- fi
- fi
- fi
- echo "yes"
- return 0
- } # end of testInterface
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement