From 4ee060b66be705c88ae87d1267600cf8ab2587e9 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 18 Jan 2022 19:34:18 -0500 Subject: [PATCH] Create update_ha.md --- misc/update_ha.md | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 misc/update_ha.md diff --git a/misc/update_ha.md b/misc/update_ha.md new file mode 100644 index 00000000..dfb4276b --- /dev/null +++ b/misc/update_ha.md @@ -0,0 +1,78 @@ +## Home Assistant Container Update ## + +In the homeassistant lxc console run `nano upha.sh` +it will open a empty file, copy and paste the Stable Branch (change TZ) +Save and exit the text editor with "Ctrl+O", "Enter" and "Ctrl+X" +To update HA, run `bash upha.sh` from the console + +Stable Branch +``` +### upha.sh ### +#!/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 --restart unless-stopped -v hass_config:/config -e TZ=US/Eastern --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" +``` + +Beta Branch +``` +### uphabeta.sh ### +#!/bin/bash + +echo -e "\e[1;33m Pulling New Beta Version... \e[0m" +docker pull homeassistant/home-assistant:beta +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 --restart unless-stopped -v hass_config:/config -e TZ=US/Eastern --net=host homeassistant/home-assistant:beta +echo -e "\e[1;33m Removing Old Image... \e[0m" +docker image prune -f +echo -e "\e[1;33m Finished Update! \e[0m" +``` + +Development Branch +``` +### uphadev.sh ### +#!/bin/bash + +echo -e "\e[1;33m Pulling New Dev Version... \e[0m" +docker pull homeassistant/home-assistant:dev +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 --restart unless-stopped -v hass_config:/config -e TZ=US/Eastern --net=host homeassistant/home-assistant:dev +echo -e "\e[1;33m Removing Old Image... \e[0m" +docker image prune -f +echo -e "\e[1;33m Finished Update! \e[0m" +``` + +Portainer-CE +``` +### upportainer.sh ### +#!/bin/bash + +echo -e "\e[1;33m Pulling New Portainer-Ce Version... \e[0m" +docker pull portainer/portainer-ce:latest +echo -e "\e[1;33m Stopping Portainer... \e[0m" +docker stop portainer +echo -e "\e[1;33m Removing Portainer... \e[0m" +docker rm portainer +echo -e "\e[1;33m Starting Portainer... \e[0m" +docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest +echo -e "\e[1;33m Removing Old Image... \e[0m" +docker image prune -f +echo -e "\e[1;33m Finished Update! \e[0m" +```