Skip to content
Snippets Groups Projects
Commit df0e4fad authored by fuzzle's avatar fuzzle
Browse files

add emergency script which reload after 10 minutes without batctl gw

parent 413eea56
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
# set some sysctl
sysctl -w vm.panic_on_oom=0 # deact reboot on oom
sysctl -w kernel.panic=80 # 80s after panic reboot
sysctl -w vm.overcommit_memory=2 # calc if enough mem is avail mmaloc
# raise prob. of proc to kill
# echo 10 > /proc/$(cat /var/run/fastd.mesh_vpn.pid)/oom_adj # deprecated
echo 700 > /proc/$(pgrep fastd)/oom_score_adj # fastd
echo 900 > /proc/$(pgrep ntp)/oom_score_adj # ntp
echo 950 > /proc/$(pgrep /usr/sbin/batadv-vis)/oom_score_adj # batvis
# if we see bat GW just exit
netz=$(batctl gwl -H|wc -l)
if [ $netz -ne 0 ] ; then
logger "emergency found network, exiting"
echo 0 > /tmp/emergency
exit 0
fi
# see ath9k for stopped
# cat /sys/kernel/debug/ieee80211/phy0/ath9k/queues
# simple counter
touch /tmp/emergency
counter=$(cat /tmp/emergency)
if [ -z $counter ] ; then counter=0 ; fi
if [ $counter -lt 10 ]
then let counter+=1; echo $counter > /tmp/emergency
else reboot
fi
echo $counter
* * * * * /lib/gluon/ssid-changer/emergency.sh
* * * * * /lib/gluon/ssid-changer/ssid-changer.sh
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