Find Uplink
#!/bin/bash
#simple uplink finder. Returns the first device to be able to ping 8.8.8.8
for i in $(ifconfig |grep encap |cut -f 1 -d ' '|grep -v lo); do
if ping -I $i -c 1 -w 20 8.8.8.8 > /dev/null; then echo $i; exit 1; fi
done
#!/bin/bash
#simple uplink finder. Returns the first device to be able to ping 8.8.8.8
for i in $(ifconfig |grep encap |cut -f 1 -d ' '|grep -v lo); do
if ping -I $i -c 1 -w 20 8.8.8.8 > /dev/null; then echo $i; exit 1; fi
done
Powered by WordPress