#!/bin/sh
oldlist=/tmp/assoclist.old
newlist=/tmp/assoclist.new
touch $oldlist # Create an empty file the first time through
while sleep 15
do
for iface in $(nvram get wl_ifnames)
do
wl -i $iface assoclist | awk '{print $2}' >> $newlist
done
for macaddr in $(grep -vxFf $oldlist $newlist)
do
arpinfo="$(arp -a | grep -iF $macaddr | awk '{print $1 " " $2}')"
logger -t wireless $macaddr $arpinfo "has connected."
done
for macaddr in $(grep -vxFf $newlist $oldlist)
do
arpinfo="$(arp -a | grep -iF $macaddr | awk '{print $1 " " $2}')"
logger -t wireless $macaddr $arpinfo "has disconnected."
done
mv $newlist $oldlist
done
#!/bin/sh
/jffs/scripts/wireless_monitor.sh &
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!