Skip to content

Commit

Permalink
print just the SSID, inline
Browse files Browse the repository at this point in the history
  • Loading branch information
scottleibrand committed Feb 6, 2017
1 parent 3cadde4 commit 4d8ec9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/oref0-online.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ifconfig | grep -A1 wlan0 | grep "inet " | awk '{print $2}' | awk -F : '{print $
ifconfig | grep -A1 bnep0 | grep "inet " | awk '{print $2}' | awk -F : '{print $2}'
echo
echo -n "At $(date), my wifi network name is "
iwconfig 2>&1 | grep ESSID
iwconfig 2>&1 | grep ESSID | awk -F : '{print $2}' | tr -d '\n'
echo -n ", and my public IP is: "
if curl -s -m 15 icanhazip.com | egrep "^[12]*[0-9]*[0-9]\.[12]*[0-9]*[0-9]\.[12]*[0-9]*[0-9]\.[12]*[0-9]*[0-9]$"; then
# if we are back on wifi (and have connectivity to icanhazip.com), shut down bluetooth
Expand Down Expand Up @@ -33,7 +33,7 @@ else
sudo dhclient wlan0
echo
echo -n "At $(date), my wifi network name is "
iwconfig 2>&1 | grep ESSID
iwconfig 2>&1 | grep ESSID | awk -F : '{print $2}' | tr -d '\n'
echo -n ", and my public IP is: "
# loop over as many MACs as are provided as arguments
if ! curl -s -m 15 icanhazip.com | egrep "^[12]*[0-9]*[0-9]\.[12]*[0-9]*[0-9]\.[12]*[0-9]*[0-9]\.[12]*[0-9]*[0-9]$"; then
Expand All @@ -57,7 +57,7 @@ else
echo
fi
echo -n "At $(date), my wifi network name is "
iwconfig 2>&1 | grep ESSID
iwconfig 2>&1 | grep ESSID | awk -F : '{print $2}' | tr -d '\n'
echo -n ", and my public IP is: "
curl -s -m 15 icanhazip.com
fi
Expand Down

0 comments on commit 4d8ec9e

Please sign in to comment.