Skip to content

Commit

Permalink
Add ecowitt to Verify Script
Browse files Browse the repository at this point in the history
  • Loading branch information
BJReplay committed Mar 1, 2023
1 parent 6144de1 commit 310d574
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,42 @@ else
fi
echo -e "${dim} - Version: ${subbold}$VER"
echo -e ""

# ecowitt
echo -e "${bold}Checking ecowitt${dim}"
echo -e "----------------------------------------------------------------------------"
CONTAINER="ecowitt"
VER=$UKN
ECOWITT=$UKN
ENV_FILE="weather/contrib/ecowitt/ecowitt.conf"
PORT="8686"
echo -e -n "${dim} - Config File ${ENV_FILE}: "
if [ ! -f ${ENV_FILE} ]; then
echo -e "${alertdim}Missing - ecowitt not set up"
else
echo -e $GOOD
fi
echo -e -n "${dim} - Container ($CONTAINER): "
RUNNING=$(docker inspect --format="{{.State.Running}}" $CONTAINER 2>/dev/null)
if [ "$RUNNING" = "true" ]; then
echo -e $GOOD
echo -e -n "${dim} - Service (port $PORT): "
if running http://localhost:$PORT/stats 200 0 2>/dev/null; then
echo -e $GOOD
VER=`curl --silent http://localhost:$PORT/stats | awk '{print $2" "$3" "$4}' | cut -d\" -f 2 2>/dev/null`
# check connection with ecowitt
if running http://localhost:$PORT/temp 200 0 2>/dev/null; then
WEATHER=`curl --silent http://localhost:$PORT/temp 2>/dev/null`
fi
echo -e "${dim} - Weather: ${subbold}${WEATHER}"
else
echo -e "${alert}ERROR: Not Listening - Logs:${alertdim}"
echo -e "---"
docker logs weather411 2>&1 | tail -11
echo -e "---${normal}"
fi
else
echo -e "${alert}ERROR: Stopped${normal}"
fi
echo -e "${dim} - Version: ${subbold}$VER"
echo -e ""

0 comments on commit 310d574

Please sign in to comment.