Commit aa92c47d authored by Gebhardt, Albrecht's avatar Gebhardt, Albrecht

use correct check on WH3080 stations

parent fc498e59
......@@ -3,12 +3,20 @@
# */15 * * * * /usr/local/bin/check-frewe.sh
PATH=$PATH:/usr/local/bin:/usr/sbin:/sbin
eval $(awk '/StationType/{print $1"="$2}' /etc/frewe-client.cfg)
frewe-client 2>&1 || \
if [ "$StationType" = "WH3080" ]; then
FWC="frewe-client -t WH3080 "
else
FWC=frewe-client
fi
echo detected ${FWC}
${FWC} 2>&1 || \
(hub-ctrl -h 0 -P 2 -p 0; sleep 5; hub-ctrl -h 0 -P 2 -p 1; sleep 5; service frewe-client restart )
frewe-client 2>&1 |grep "Sensor contact lost" -q && \
${FWC} 2>&1 |grep "Sensor contact lost" -q && \
(hub-ctrl -h 0 -P 2 -p 0; sleep 5; hub-ctrl -h 0 -P 2 -p 1; sleep 5; service frewe-client restart )
frewe-client 2>&1 |grep "out of range" -q && \
${FWC} 2>&1 |grep "out of range" -q && \
(hub-ctrl -h 0 -P 2 -p 0; sleep 5; hub-ctrl -h 0 -P 2 -p 1; sleep 5; service frewe-client restart )
service frewe-client status|grep " active" || service frewe-client restart
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment