"wlanwatchdog.sh" re-fix missing ';' and fix indentation

This commit is contained in:
Marc René Schädler 2013-11-18 07:56:02 +01:00
parent 6f1b52d393
commit e2cdbae554
1 changed files with 24 additions and 29 deletions

View File

@ -106,7 +106,7 @@ scan_wlan() {
}
fsm_load() {
if [ -f "$STATEFILE" ] then
if [ -f "$STATEFILE" ]; then
STATE=""
SINCE=""
. "$STATEFILE" || return 1
@ -138,33 +138,28 @@ fsm_transition() {
local OLDSTATE=$STATE
case $STATE in
working)
if [ $(count_neighbours) -eq 0 ] && [ $(count_clients) -eq 0 ] then
if [ $(count_neighbours) -eq 0 ] && [ $(count_clients) -eq 0 ]; then
STATE=pending
fi
;;
pending)
if [ $AGE -ge $TIMEOUT_MEDIUM ] then
if [ $AGE -ge $TIMEOUT_MEDIUM ]; then
STATE=error
elif [ $(count_originators) -eq 0 ] && [ $AGE -ge $TIMEOUT_SHORT ]
then
elif [ $(count_originators) -eq 0 ] && [ $AGE -ge $TIMEOUT_SHORT ]; then
STATE=error
elif [ $(count_neighbours) -gt 0 ] || [ $(count_clients) -gt 0 ]
then
elif [ $(count_neighbours) -gt 0 ] || [ $(count_clients) -gt 0 ]; then
STATE=working
fi
;;
*)
if [ $AGE -ge $TIMEOUT_LONG ]
then
if [ $AGE -ge $TIMEOUT_LONG ]; then
STATE=error
elif [ $(count_neighbours) -gt 0 ] || [ $(count_clients) -gt 0 ]
then
elif [ $(count_neighbours) -gt 0 ] || [ $(count_clients) -gt 0 ]; then
STATE=working
fi
;;
esac
if [ ! "$OLDSTATE" == "$STATE" ]
then
if [ ! "$OLDSTATE" == "$STATE" ]; then
echo "$(date) '$OLDSTATE' -> '$STATE'"
fsm_entry
fi