浏览代码

Minor update

Bohan Yang 5 年之前
父节点
当前提交
12904768e5
共有 2 个文件被更改,包括 12 次插入6 次删除
  1. 1 1
      README.md
  2. 11 5
      netboot.sh

+ 1 - 1
README.md

@@ -63,5 +63,5 @@ This script is used to re-install VPS to **Debian 9 (stretch) or 10 (buster)** w
 ### `cloud`
 ### `cloud`
 
 
  - `--protocol https`
  - `--protocol https`
- - `--mirror cdn-aws.deb.debian.org`
+ - `--mirror deb.debian.org`
  - `--security true`
  - `--security true`

+ 11 - 5
netboot.sh

@@ -14,7 +14,7 @@ read_secret()
 {
 {
     stty -echo
     stty -echo
     trap 'stty echo' EXIT
     trap 'stty echo' EXIT
-    read "$@"
+    read -r "$@"
     stty echo
     stty echo
     trap - EXIT
     trap - EXIT
     echo
     echo
@@ -157,7 +157,7 @@ if [ -n "$DEBI_PRESET" ]; then
             ;;
             ;;
         cloud)
         cloud)
             DEBI_PROTOCOL=${DEBI_PROTOCOL:-https}
             DEBI_PROTOCOL=${DEBI_PROTOCOL:-https}
-            DEBI_MIRROR=${DEBI_MIRROR:-cdn-aws.deb.debian.org}
+            DEBI_MIRROR=${DEBI_MIRROR:-deb.debian.org}
             DEBI_SECURITY=${DEBI_SECURITY:-true}
             DEBI_SECURITY=${DEBI_SECURITY:-true}
             ;;
             ;;
         *)
         *)
@@ -170,7 +170,7 @@ DEBI_SUITE=${DEBI_SUITE:-stable}
 DEBI_NEW="debian-$DEBI_SUITE"
 DEBI_NEW="debian-$DEBI_SUITE"
 DEBI_NEW_DIR="/boot/$DEBI_NEW"
 DEBI_NEW_DIR="/boot/$DEBI_NEW"
 
 
-save_preseed=cat
+save_preseed="cat"
 if [ "$DEBI_DRY_RUN" != true ]; then
 if [ "$DEBI_DRY_RUN" != true ]; then
     user="$(id -un 2>/dev/null || true)"
     user="$(id -un 2>/dev/null || true)"
 
 
@@ -264,9 +264,15 @@ if [ "$DEBI_SKIP_USER" != true ]; then
 
 
     if command_exists mkpasswd; then
     if command_exists mkpasswd; then
         if [ -z "$DEBI_PASSWORD" ]; then
         if [ -z "$DEBI_PASSWORD" ]; then
-            DEBI_PASSWORD="$(mkpasswd -m sha-512)"
+            DEBI_PASSWORD="$(mkpasswd -m sha512crypt)"
         else
         else
-            DEBI_PASSWORD="$(mkpasswd -m sha-512 "$DEBI_PASSWORD")"
+            DEBI_PASSWORD="$(mkpasswd -m sha512crypt "$DEBI_PASSWORD")"
+        fi
+    elif command_exists busybox; then
+        if [ -z "$DEBI_PASSWORD" ]; then
+            DEBI_PASSWORD="$(busybox mkpasswd -m sha512)"
+        else
+            DEBI_PASSWORD="$(busybox mkpasswd -m sha512 "$DEBI_PASSWORD")"
         fi
         fi
     elif command_exists python3; then
     elif command_exists python3; then
         if [ -z "$DEBI_PASSWORD" ]; then
         if [ -z "$DEBI_PASSWORD" ]; then