Skip to content
Snippets Groups Projects
Commit 25a8782f authored by rubo77's avatar rubo77
Browse files

shorter uptime determination

parent f0461e08
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,8 @@ safety_exit() { ...@@ -8,7 +8,8 @@ safety_exit() {
exit 2 exit 2
} }
pgrep -f autoupdater >/dev/null && safety_exit 'autoupdater running' pgrep -f autoupdater >/dev/null && safety_exit 'autoupdater running'
[ $(cat /proc/uptime | sed 's/\..*//g') -gt 60 ] || safety_exit 'less than one minute' UT=$(sed 's/\..*//g' /proc/uptime)
[ $UT -gt 60 ] || safety_exit 'less than one minute'
[ $(find /var/run -name hostapd-phy* | wc -l) -gt 0 ] || safety_exit 'no hostapd-phy*' [ $(find /var/run -name hostapd-phy* | wc -l) -gt 0 ] || safety_exit 'no hostapd-phy*'
# only once every timeframe minutes the SSID will change to the Offline-SSID # only once every timeframe minutes the SSID will change to the Offline-SSID
...@@ -101,7 +102,7 @@ else ...@@ -101,7 +102,7 @@ else
CHECK="$(batctl gwl -H|grep -v "gateways in range"|wc -l)" CHECK="$(batctl gwl -H|grep -v "gateways in range"|wc -l)"
fi fi
UP=$(($(cat /proc/uptime | sed 's/\..*//g') / 60)) UP=$(($UT / 60))
M=$(($UP % $MINUTES)) M=$(($UP % $MINUTES))
HUP_NEEDED=0 HUP_NEEDED=0
......
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