#!/bin/bash

   DOMO_IP="localhost"             # Domoticz IP Address
   DOMO_PORT="81"                    # Domoticz Port
   IDX=330
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/usr/local/lib/
cnt=`tail -n50000 /var/log/domoticz.log |grep -y "Error: RFXCOM: TX time out"|wc -l`

if [ "cnt" -gt 0 ]; then
	service domoticz restart
fi

exit 0
