pull/8/head
Bohan Yang 5 years ago committed by GitHub
parent f51e71ea8d
commit e2433cbe5d
  1. 13
      netboot.sh

@ -302,16 +302,17 @@ if [ "$skip_account_setup" != true ]; then
if command_exists mkpasswd; then if command_exists mkpasswd; then
if [ -z "$password" ]; then if [ -z "$password" ]; then
password="$(mkpasswd -m sha512crypt)" password="$(mkpasswd -m sha-512)"
else else
password="$(mkpasswd -m sha512crypt "$password")" password="$(mkpasswd -m sha-512 "$password")"
fi fi
elif command_exists busybox && busybox mkpasswd --help >/dev/null 2>&1; then elif command_exists busybox && busybox mkpasswd --help >/dev/null 2>&1; then
if [ -z "$password" ]; then if [ -z "$password" ]; then
password="$(busybox mkpasswd -m sha512)" printf '\n%s' 'Password: ' 1>&2
else read -rs password
password="$(busybox mkpasswd -m sha512 "$password")" echo 1>&2
fi fi
password="$(busybox mkpasswd -m sha512 "$password")"
elif command_exists python3; then elif command_exists python3; then
if [ -z "$password" ]; then if [ -z "$password" ]; then
password="$(python3 -c 'import crypt, getpass; print(crypt.crypt(getpass.getpass(), crypt.mksalt(crypt.METHOD_SHA512)))')" password="$(python3 -c 'import crypt, getpass; print(crypt.crypt(getpass.getpass(), crypt.mksalt(crypt.METHOD_SHA512)))')"
@ -321,7 +322,9 @@ if [ "$skip_account_setup" != true ]; then
else else
cleartext_password=true cleartext_password=true
if [ -z "$password" ]; then if [ -z "$password" ]; then
printf '\n%s' 'Password: ' 1>&2
read -rs password read -rs password
echo 1>&2
fi fi
fi fi

Loading…
Cancel
Save