Created
July 11, 2014 02:08
Revisions
-
jgrevich created this gist
Jul 11, 2014 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ #!/bin/bash # setup constants CURRENT_LIST_PATH=/tmp/wifi_client_macs_current PREVIOUS_LIST_PATH=/tmp/wifi_client_macs_previous while [ "true" ] do # backup old file if it exists if [ -f $CURRENT_LIST_PATH ]; then cp $CURRENT_LIST_PATH $PREVIOUS_LIST_PATH fi # grab MACs from 2.4Ghz radio wl -i eth1 assoclist | cut -d" " -f2 > $CURRENT_LIST_PATH # grab MACs from 5Ghz radio wl -i eth2 assoclist | cut -d" " -f2 >> $CURRENT_LIST_PATH # do something if desired mac appears in list if grep -Fxq "3C:15:C2:18:F1:8F" $CURRENT_LIST_PATH then echo "Justin is home" else printf "." fi sleep 1 done