SonicChicken

A bumbling foray into tumblr...


bash network sensor

I had to check a few network ports in the office today, to see if they were “hot”. My laptop doesn’t have a NIC status light, so I whipped out this little bash script to continually check for a CSUS (130.86.nnn.mmm) network connection. This loops every second and outputs either a campus IP address or “no campus network connection”.

while true; do 
    ifconfig -u | grep " 130\.86\." || echo "no campus network connection"
    sleep 1
done

Notes

  1. sonicchicken posted this