瀏覽代碼

Update core-restore-from-backup.sh

tteckster 2 年之前
父節點
當前提交
ca08e20253
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      misc/core-restore-from-backup.sh

+ 1 - 1
misc/core-restore-from-backup.sh

@@ -46,6 +46,7 @@ function msg_error() {
     local msg="$1"
     echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
 }
+if [ -z "$(ls -A /root/.homeassistant/backups/)" ]; then msg_error "No backups found! \n"; exit 1; fi
 DIR=/root/.homeassistant/restore
 if [ -d "$DIR" ];
 then
@@ -54,7 +55,6 @@ else
     mkdir -p /root/.homeassistant/restore
     msg_ok "Created Restore Directory."
 fi
-if [ -z "$(ls -A /root/.homeassistant/backups/)" ]; then msg_error "No backups found! \n"; exit 1; fi
 cd /root/.homeassistant/backups/
 PS3="Please enter your choice: "
 files="$(ls -A .)"