From 0e51f668b660c6acd535d11f3b4b6aa9aeb9d762 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 8 Feb 2022 22:06:47 -0500 Subject: [PATCH] Update ha_setup.sh --- setup/ha_setup.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/setup/ha_setup.sh b/setup/ha_setup.sh index 953df9e7..cd560b24 100644 --- a/setup/ha_setup.sh +++ b/setup/ha_setup.sh @@ -94,6 +94,30 @@ docker run -d \ -v /etc/timezone:/etc/timezone:ro\ --net=host \ homeassistant/home-assistant:stable &>/dev/null +file_path="/root/update.sh" +echo "#!/bin/bash +echo -e "\e[1;33m Pulling New Stable Version... \e[0m" +docker pull homeassistant/home-assistant:stable +echo -e "\e[1;33m Stopping Home Assistant... \e[0m" +docker stop homeassistant +echo -e "\e[1;33m Removing Home Assistant... \e[0m" +docker rm homeassistant +echo -e "\e[1;33m Starting Home Assistant... \e[0m" +docker run -d \ + --name homeassistant \ + --privileged \ + --restart unless-stopped \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v /dev:/dev \ + -v hass_config:/config \ + -v /etc/localtime:/etc/localtime:ro \ + -v /etc/timezone:/etc/timezone:ro\ + --net=host \ + homeassistant/home-assistant:stable +echo -e "\e[1;33m Removing Old Image... \e[0m" +docker image prune -f +echo -e "\e[1;33m Finished Update! \e[0m"" > $file_path +sudo chmod +x /root/update.sh echo -e "${CHECKMARK} \e[1;92m Customizing LXC... \e[0m" rm /etc/motd