浏览代码

Update haos-vm.sh

add SSH_CHECK
tteckster 2 年之前
父节点
当前提交
6bf9e68f89
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      vm/haos-vm.sh

+ 13 - 0
vm/haos-vm.sh

@@ -95,6 +95,18 @@ function ARCH_CHECK() {
     exit
     exit
   fi
   fi
 }
 }
+function SSH_CHECK() {
+  if command -v pveversion >/dev/null 2>&1; then
+    if [ -n "$SSH_CLIENT" ]; then
+      if whiptail --defaultno --title "SSH DETECTED" --yesno "It's suggested to use the Proxmox shell instead of SSH, since SSH can create issues while gathering variables. Would you like to proceed with using SSH?" 10 62; then
+        echo "you've been warned"
+      else
+        clear
+        exit
+      fi
+    fi
+  fi
+}
 function default_settings() {
 function default_settings() {
   BRANCH="$stable"
   BRANCH="$stable"
   VMID="$NEXTID"
   VMID="$NEXTID"
@@ -257,6 +269,7 @@ function START_SCRIPT() {
 }
 }
 ARCH_CHECK
 ARCH_CHECK
 PVE_CHECK
 PVE_CHECK
+SSH_CHECK
 START_SCRIPT
 START_SCRIPT
 msg_info "Validating Storage"
 msg_info "Validating Storage"
 while read -r line; do
 while read -r line; do