Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tracking with wifi and a mac address
#!/bin/sh
client="E0:F8:47:86:01:C2" #iPhone
logfile="/jffs/wifilog-$(date +"%m%d")-$client.log"
assoclist=$(wl assoclist | grep $client)
notconnmsg="$(date +"%T") Disconnected"
connmsg="$(date +"%T") Connected"
if [ ! -f $logfile ]; then
echo $notconnmsg > $logfile
fi
if [ -z $assoclist ]; then # Client is not connected
echo $(tail -n 1 $logfile) - $notconnmsg
if [ -z $(tail -n 1 $logfile | grep "Disconnected") ]; then # Last log is connected show not connected message
echo $notconnmsg >> $logfile
fi
else # Client is connected
echo $(tail -n 1 $logfile) - $connmsg
if [ -z $(tail -n 1 $logfile | grep "Connected") ]; then # Last log is not connected show connected message
echo $connmsg >> $logfile
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.