Skip to content

Instantly share code, notes, and snippets.

@hannesbe
Created December 4, 2017 06:00
Show Gist options
  • Save hannesbe/ecec6b15aa89c9d8e53c496bd3be3fb2 to your computer and use it in GitHub Desktop.
Save hannesbe/ecec6b15aa89c9d8e53c496bd3be3fb2 to your computer and use it in GitHub Desktop.
Upgrade Home Assistant in virtualenv
function hass-upgrade {
echo "Stopping homeassistant"
sudo systemctl stop home-assistant@homeassistant.service
sudo -u homeassistant -H /bin/bash <<EOF
echo "Activating virtualenv"
source /srv/homeassistant/bin/activate
echo "Upgrading homeassistant"
pip3 install --upgrade homeassistant
echo "Deactivating virtualenv"
deactivate
EOF
echo "Starting homeassistant"
sudo systemctl start home-assistant@homeassistant.service
}
hass-upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment