1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/homeassistant_ynh.git synced 2024-09-03 19:26:16 +02:00
homeassistant_ynh/conf/homeassistant_conf_files/bin/upgrade_homeassistant.sh
2020-11-14 14:10:51 +01:00

25 lines
553 B
Bash
Executable file

#!/bin/bash
# define usefull variables
app="homeassistant"
final_path="/opt/yunohost/$app"
local MY_PYTHON=$(readlink -e "$final_path/bin/python")
# create the virtual environment
$MY_PYTHON -m venv "$final_path"
# activate the virtual environment
source "$final_path/bin/activate"
# install last version of pip
pip install --upgrade pip
# install last version of wheel
pip install --upgrade wheel
# upgrade homeassistant python package
pip install --upgrade $app
# restart homeassistant systemd service
sudo systemctl restart $app@$app.service