mirror of
https://github.com/tteck/Proxmox.git
synced 2024-11-26 16:43:17 +01:00
Update esphome-install.sh
install esphome in a python virtual environment
This commit is contained in:
parent
22b77fdb76
commit
4651827151
@ -30,20 +30,27 @@ rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
|||||||
msg_ok "Updated Python3"
|
msg_ok "Updated Python3"
|
||||||
|
|
||||||
msg_info "Installing ESPHome"
|
msg_info "Installing ESPHome"
|
||||||
|
mkdir /srv/esphome
|
||||||
|
cd /srv/esphome
|
||||||
|
python3 -m venv .
|
||||||
|
source bin/activate
|
||||||
$STD pip install esphome tornado esptool
|
$STD pip install esphome tornado esptool
|
||||||
msg_ok "Installed ESPHome"
|
msg_ok "Installed ESPHome"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
service_path="/etc/systemd/system/esphomeDashboard.service"
|
cat <<EOF >/etc/systemd/system/esphomeDashboard.service
|
||||||
echo "[Unit]
|
[Unit]
|
||||||
Description=ESPHome Dashboard
|
Description=ESPHome Dashboard
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/local/bin/esphome dashboard /root/config/
|
ExecStart=/srv/esphome/bin/esphome dashboard /root/config/
|
||||||
Restart=always
|
Restart=always
|
||||||
User=root
|
User=root
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target" >$service_path
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
systemctl enable -q --now esphomeDashboard.service
|
systemctl enable -q --now esphomeDashboard.service
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user