瀏覽代碼

Update magicmirror-install.sh (#857) (#858)

Change connection prompt to allow bypass

Co-authored-by: ThellraAK <github.com@absurdlybored.com>
tteckster 2 年之前
父節點
當前提交
5b03b47ee6
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      setup/magicmirror-install.sh

+ 8 - 2
setup/magicmirror-install.sh

@@ -61,8 +61,14 @@ msg_ok "Network Connected: ${BL}$(hostname -I)"
 set +e
 alias die=''
 if nc -zw1 8.8.8.8 443; then msg_ok "Internet Connected"; else
-        msg_error "Internet NOT Connected"
-        exit 1
+  msg_error "Internet NOT Connected"
+    read -r -p "Would you like to continue anyway? <y/N> " prompt
+    if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
+      echo -e " ⚠️  ${RD}Expect Issues Without Internet${CL}"
+    else
+      echo -e " 🖧  Check Network Settings"
+      exit 1
+    fi
 fi
 RESOLVEDIP=$(nslookup "github.com" | awk -F':' '/^Address: / { matched = 1 } matched { print $2}' | xargs)
 if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to $RESOLVEDIP"; fi