Skip to content
Snippets Groups Projects
Commit f135ba05 authored by viisauksena's avatar viisauksena Committed by GitHub
Browse files

Merge pull request #5 from rubo77/patch-1

Update repository to rewritten script
parents 59490719 2aa896ec
No related branches found
No related tags found
No related merge requests found
ssid-changer
ssid-changer.sh
===============
This script changes the SSID when there is no connection to the selected Gateway.
Once a minute it checks if there is a gateway reacheable with `batctl gwl -H` and
decides if a change of the SSID is necessary.
*It is a simplified rewrite of https://github.com/ffac/gluon-ssid-changer that doesn't check
the tx value any more. It is in use in Freifunk Freiburg*
emergency.sh
============
this repository also includes an emergency script which checks for a working batman-adv
gateway connection. If no Gateway connection exists some countermeasures are started:
Script to change the SSID when there is no suffic sufficient connection to the selected Gateway.
- 3 min offline - call `wifi`
- 5 min offline - restart fastd
- 7 min offline - restart networking
It is quite basic, it just checks the Quality of the Connection and decides if a change of the SSID is necessary.
If no countermeasure works bringing the node online again, the router will be enforced
to reboot after 10 minutes.
Create a file "modules" with the following content in your <a href="https://github.com/ffac/site/tree/offline-ssid"> site directory:</a>
*Note: this script may cause a problem for users, that use the node on purposes intended
to work without functioning gateway connectivity, for example as a switch (disable
the cronjob there).*
Gluon versions
==============
This branch of the skript contains the the ssid-changer version for the gluon 2016.1.x
based on openwrt `chaos-calmer`. There is also a pre 2016.1 (barrier braker based)
version in the branch `master`. It will probably not work in 2016.2 yet.
Implement this package in your firmware
=======================================
Create a file "modules" with the following content in your
<a href="https://github.com/ffac/site/tree/offline-ssid"> site directory:</a>
GLUON_SITE_FEEDS="ssidchanger"<br>
PACKAGES_SSIDCHANGER_REPO=https://github.com/ffac/gluon-ssid-changer.git<br>
......@@ -13,5 +42,3 @@ PACKAGES_SSIDCHANGER_COMMIT=1146ff354ff0bb99a100d6b067fc410068e7521d<br>
PACKAGES_SSIDCHANGER_BRANCH=chaos-calmer<br>
With this done you can add the package gluon-ssid-changer to your site.mk
This branch of the skript contains the the ssid-changer version for the current master based on openwrt chaos-calmer (upcoming 2016.1)
......@@ -17,7 +17,7 @@ echo 950 > /proc/$(pgrep /usr/sbin/batadv-vis)/oom_score_adj # batvis
# if we see bat GW just exit
netz=$(batctl gwl -H|grep -v "gateways in range"|wc -l)
if [ $netz -ne 0 ] ; then
if [ $netz -ne 0 ] ; then
echo "$0 found GW in network, exiting"
echo 0 > /tmp/emergency
exit 0
......@@ -26,17 +26,17 @@ fi
# see ath9k for stopped
# cat /sys/kernel/debug/ieee80211/phy0/ath9k/queues
# simple counter
# simple counter
touch /tmp/emergency
counter=$(cat /tmp/emergency)
if [ -z $counter ] ; then counter=0 ; fi
if [ $counter -lt 10 ]
then
then
let counter+=1
echo $counter > /tmp/emergency
if [ $counter -eq 3 ]; then echo "$0 - 3 min offline - try wifi"|logger; wifi ; fi
if [ $counter -eq 5 ]; then echo "$0 - 5 min offline - try restart fastd"|logger; /etc/init.d/fastd restart ; fi
if [ $counter -eq 7 ]; then echo "$0 - 5 min offline - try restart network"|logger; /etc/init.d/network restart ; fi
if [ $counter -eq 7 ]; then echo "$0 - 7 min offline - try restart network"|logger; /etc/init.d/network restart ; fi
else reboot
fi
fi
echo $counter
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment