Skip to content

Instantly share code, notes, and snippets.

@Teagan42
Created May 28, 2019 01:48
Show Gist options
  • Save Teagan42/11a04007d8bc60ba3d1cc84f2bb399e6 to your computer and use it in GitHub Desktop.
Save Teagan42/11a04007d8bc60ba3d1cc84f2bb399e6 to your computer and use it in GitHub Desktop.
Automatically Reload Home-Assistant Configuration on Git Push
#!/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