Skip to content
Snippets Groups Projects
Commit 35fa15bc authored by rubo77's avatar rubo77
Browse files

add safety checks on start

parent b008c424
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
#################
# safety checks #
#################
safety_exit() {
echo $1, exiting with error code 2
exit 2
}
pgrep -f autoupdater >/dev/null && safety_exit 'autoupdater running'
[ $(cat /proc/uptime | sed 's/\..*//g') -gt 60 ] || safety_exit 'less than one minute'
[ $(find /var/run -name hostapd-phy* | wc -l) -lt 0 ] || safety_exit 'no hostapd-phy*'
# only once every timeframe the SSID will change to OFFLINE (set to 1 minute to change every time the router gets offline)
MINUTES="$(uci -q get ssid-changer.settings.switch_timeframe)"
# the first few minutes directly after reboot within which an Offline-SSID always may be activated
......
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