I have created a .sh file where I have the steps to stop, upgrade and start Home Assistant.
#!/bin/bash
sudo systemctl stop [email protected]
sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
python3 -m pip install --upgrade homeassistant
deactivate
su pi
sudo systemctl start [email protected]
I’m not a Linux guru, but I understand It’s not possible to run this as it involves changing user (and maybe the Virtual Pyton environment makes it difficult).
All steps are working if I manually enter them one by one.
I want to automate this a bit. Thanks for all advice!