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

26 lines
553 B
Bash
Raw Normal View History

2019-06-09 18:30:25 +02:00
#!/bin/bash
# define usefull variables
app="homeassistant"
final_path="/opt/yunohost/$app"
2020-11-14 14:10:51 +01:00
local MY_PYTHON=$(readlink -e "$final_path/bin/python")
2019-06-09 18:30:25 +02:00
# create the virtual environment
2020-11-14 14:10:51 +01:00
$MY_PYTHON -m venv "$final_path"
2019-06-09 18:30:25 +02:00
# activate the virtual environment
2020-11-14 14:10:51 +01:00
source "$final_path/bin/activate"
2019-06-09 18:30:25 +02:00
2020-11-14 14:10:51 +01:00
# install last version of pip
pip install --upgrade pip
# install last version of wheel
pip install --upgrade wheel
2019-06-09 18:30:25 +02:00
# upgrade homeassistant python package
2020-11-14 14:10:51 +01:00
pip install --upgrade $app
2019-06-09 18:30:25 +02:00
# restart homeassistant systemd service
sudo systemctl restart $app@$app.service