浏览代码

Update esphome.sh

update the installation of either standard or venv
tteckster 2 年之前
父节点
当前提交
22b77fdb76
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      ct/esphome.sh

+ 5 - 2
ct/esphome.sh

@@ -52,13 +52,16 @@ function default_settings() {
 
 function update_script() {
 header_info
-if [[ ! -f /usr/local/bin/esphome ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
+if [[ ! -f /etc/systemd/system/esphomeDashboard.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
 msg_info "Stopping ESPHome"
 systemctl stop esphomeDashboard
 msg_ok "Stopped ESPHome"
 
 msg_info "Updating ESPHome"
-pip3 install esphome --upgrade &>/dev/null
+if [[ -d /srv/esphome ]]; then
+  source /srv/esphome/bin/activate &>/dev/null
+fi
+pip3 install -U esphome &>/dev/null
 msg_ok "Updated ESPHome"
 
 msg_info "Starting ESPHome"