17 lines
673 B
Bash
Executable File
17 lines
673 B
Bash
Executable File
#!/bin/sh
|
|
PATH=$PATH:/usr/local/bin
|
|
#
|
|
# Easy invocation of python script
|
|
# Add the following to crontab:
|
|
# @daily /<path-to-your-script>/wrapper-sensors-battery.sh
|
|
#
|
|
result=$(/home/mischa/hue/get-sensors.py $(cat /home/mischa/hue-bridge) $(cat /home/mischa/hue-token) -b 20)
|
|
result2=$(/home/mischa/hue/get-sensors.py $(cat /home/mischa/hue-bridge2) $(cat /home/mischa/hue-token2) -b 20)
|
|
|
|
if [[ -n "$result" ]]; then
|
|
echo "${result}" | mail -s "Hue Battery Status $(cat /home/mischa/hue-bridge)" $(cat /home/mischa/hue-email)
|
|
fi
|
|
if [[ -n "$result2" ]]; then
|
|
echo "${result2}" | mail -s "Hue Battery Status $(cat /home/mischa/hue-bridge2)" $(cat /home/mischa/hue-email)
|
|
fi
|