#!/bin/sh # fonstatus.sh v 1.3 by SkyNETbbs # credits go to # http://www.tuttoeniente.net/stato-fonera/ # http://www.francofon.fr # Adjusted to work with FreeWLAN Addons by ChrisPHL # . /etc/functions.sh config_load fonerabe config_get fbss_enable heartbeat enable config_load fon config_get pubssid public essid if enabled $fbss_enable; then if [ "$1" == "cron" ]; then # introduce randomizer value=241 while [ $value -gt 240 ] ; do value=`cat /dev/urandom | hexdump -d | head -1 | awk '{ print $3}'` value=`expr $value % 1000` done # now sleep for that time. echo $value sleep $value remote="http://www.leeman.be/fon/status.php" if [ -f /tmp/eth0_mac ]; then mac="`cat /tmp/eth0_mac`" else mac="$( ifconfig eth0|grep HWaddr|sed -e "s/^.*HWaddr //" |sed -e "s/ //g" )" fi fon_time=$(cat /proc/uptime);fon_time=${fon_time%% *} uon_pub=$(wlanconfig ath0 list | grep -v UAPSD 2> /dev/null |grep -c ':') uon_pri=$(wlanconfig ath1 list | grep -v UAPSD 2> /dev/null |grep -c ':') rxdata=$(/sbin/ifconfig tun0 | grep "(" | sed 's/.*(\([^)]*\)).*(\([^)]*\))/\1/g' | awk '{print $1$2}') txdata=$(/sbin/ifconfig tun0 | grep "(" | sed 's/.*(\([^)]*\)).*(\([^)]*\))/\2/g' | awk '{print $1$2}') model=`cat /etc/fon_device` titel="FON_${pubssid}" scream="$remote?mac=$mac&time=$fon_time&publ=$uon_pub&priv=$uon_pri&rxdatas=$rxdata&txdatas=$txdata&model=$model&title=$titel" wget -O /dev/null ${scream} >/dev/null 2>&1 fi fi