forked from freifunk-franken/firmware
Scripts for pushing mac adress of client to a server if a client associates
This commit is contained in:
parent
b8e5b29c11
commit
5ace9c2b82
|
@ -0,0 +1,15 @@
|
|||
MESH_INTERFACE="br-mesh"
|
||||
CLIENT_INTERFACES="wlan0"
|
||||
|
||||
#CLIENTS
|
||||
SEDDEV=`brctl showstp $MESH_INTERFACE | egrep '\([0-9]\)' | sed -e "s/(//;s/)//" | awk '{ print "s/^ "$2"/"$1"/;" }'`
|
||||
|
||||
for entry in $CLIENT_INTERFACES; do
|
||||
CLIENT_MACS=$CLIENT_MACS`brctl showmacs $MESH_INTERFACE | sed -e "$SEDDEV" | awk '{if ($3 != "yes" && $1 == "'"$entry"'") print $2}'`" "
|
||||
done
|
||||
|
||||
i=0
|
||||
for client in $CLIENT_MACS; do
|
||||
i=`expr $i + 1` #Zähler um eins erhöhen
|
||||
done
|
||||
echo $i
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
while read LINE
|
||||
do
|
||||
if [ "`echo $LINE | grep 'wlan0:'`" != "" ]; then
|
||||
wget -q -O - http://status.kreativitaet-trifft-technik.de/update/ff\?client_associated=`date +%s`\&clients_count=`/etc/clients.sh` & sleep 3; kill $!
|
||||
#echo http://status.kreativitaet-trifft-technik.de/update/ff\?client_associated=`date +%s`\&clients_count=`/etc/clients.sh` & sleep 3; kill $!
|
||||
|
||||
fi
|
||||
#echo `echo $LINE | grep 'wlan0:' | awk '{ print $4 }'` >> /var/log/clients_event.log
|
||||
done
|
||||
|
||||
|
|
@ -47,4 +47,7 @@ httpd -h /tmp/crawldata
|
|||
|
||||
sh /etc/configurator.sh
|
||||
|
||||
#do something if a client associates
|
||||
#iw event -f | /etc/clients_event.sh &
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue