-
-
Save cholin/10ea7e55347eca71eae2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
MSG="No batman nodes in range ..." | |
batctl o | grep -q "$MSG" | |
if [ $? -eq 0 ]; then | |
filename=$(date +'wifi-check_%Y-%m-%d_%H-%M.log') | |
logread > "/tmp/$filename" | |
wifi | |
msg="wifi seems stucked - restarting. Logg saved: $filename". | |
logger -p "error" -t wifi-check $msg | |
else | |
bat_peers=$(($(batctl o | wc -l) - 2)) | |
msg="wifi seems working. We have $bat_peers batman-adv peers" | |
logger -p "info" -t wifi-check $msg | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment