Created
May 28, 2019 01:48
-
-
Save Teagan42/11a04007d8bc60ba3d1cc84f2bb399e6 to your computer and use it in GitHub Desktop.
Automatically Reload Home-Assistant Configuration on Git Push
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ha_container_name="home-assistant" | |
use_systemctl=0 | |
docker exec $ha_container_name sh -c "python -m homeassistant -c /config --script check_config" | |
if [ $? -ne 0 ]; then | |
exit | |
fi | |
if [ $use_systemctl -eq 0 ]; then | |
docker restart $ha_container_name | |
else | |
systemctl restart docker-$ha_container_name.service | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment