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
|