From 02ed0dc3ef4644c99ede454801487848585f8ec6 Mon Sep 17 00:00:00 2001 From: Bohan Yang Date: Wed, 14 Oct 2020 21:09:05 +0800 Subject: [PATCH] Update --- README.md | 2 +- netboot.sh | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4b1ec29..03e8f59 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ This script is used to re-install VPS to **Debian 9 (stretch) or 10 (buster)** w - `--mirror-protocol http` [`http`, `https`, `ftp`] - `--mirror-host deb.debian.org` - `--mirror-directory /debian` - - `--suite stable` + - `--suite buster` - `--skip-account-setup` - `--username debian` - `--password` diff --git a/netboot.sh b/netboot.sh index 09808c5..7430337 100644 --- a/netboot.sh +++ b/netboot.sh @@ -198,7 +198,7 @@ if [ -n "$preset" ]; then esac fi -suite=${suite:-stable} +suite=${suite:-buster} installer="debian-$suite" installer_directory="/boot/$installer" @@ -302,27 +302,34 @@ if [ "$skip_account_setup" != true ]; then if command_exists mkpasswd; then if [ -z "$password" ]; then + printf 'Password: ' 1>&2 password="$(mkpasswd -m sha512crypt)" + echo 1>&2 else password="$(mkpasswd -m sha512crypt "$password")" fi elif command_exists busybox && busybox mkpasswd --help >/dev/null 2>&1; then if [ -z "$password" ]; then + printf 'Password: ' 1>&2 password="$(busybox mkpasswd -m sha512)" + echo 1>&2 else password="$(busybox mkpasswd -m sha512 "$password")" fi elif command_exists python3; then if [ -z "$password" ]; then + printf 'Password: ' 1>&2 password="$(python3 -c 'import crypt, getpass; print(crypt.crypt(getpass.getpass(), crypt.mksalt(crypt.METHOD_SHA512)))')" + echo 1>&2 else password="$(python3 -c "import crypt; print(crypt.crypt(\"$password\", crypt.mksalt(crypt.METHOD_SHA512)))")" fi else cleartext_password=true if [ -z "$password" ]; then - printf 'Password: ' + printf 'Password: ' 1>&2 read -rs password + echo 1>&2 fi fi