commit 8742d1e32a857518c5be6e06eb53d21025654f3d from: mischa date: Wed Nov 06 23:36:13 2019 UTC don't send empty emails commit - 440a9b96ee7a2974aae8162ad1ec12fa7d08465e commit + 8742d1e32a857518c5be6e06eb53d21025654f3d blob - 6412bd2ad19932ee017ef5c75c9fda467ccecff5 blob + fd6207af09fd2a71704cc431a0ea2fccfdab4cf4 --- wrapper-sensors-battery.sh +++ wrapper-sensors-battery.sh @@ -5,4 +5,8 @@ PATH=$PATH:/usr/local/bin # Add the following to crontab: # @daily //wrapper-sensors-battery.sh # -(/home/mischa/hue/get-sensors.py $(cat /home/mischa/hue-bridge) $(cat /home/mischa/hue-token) -b 60) | mail -s "Hue Battery Status" $(cat /home/mischa/hue-email) +result=$(/home/mischa/hue/get-sensors.py $(cat /home/mischa/hue-bridge) $(cat /home/mischa/hue-token) -b 20) + +if [ -n "$result" ]; then + echo "${result}" | mail -s "Hue Battery Status" $(cat /home/mischa/hue-email) +fi