pull/8/head
Bohan Yang 5 years ago committed by GitHub
parent a60ae20642
commit 0306b45eb8
  1. 15
      debi.sh

@ -353,14 +353,13 @@ d-i mirror/udeb/suite string $suite
EOF EOF
if [ "$account_setup" = true ]; then if [ "$account_setup" = true ]; then
if command_exists mkpasswd; then password_hash=$(mkpasswd -m sha-256 "$password" 2> /dev/null) ||
password_hash=$(mkpasswd -m sha-256 "$password") password_hash=$(openssl passwd -5 "$password" 2> /dev/null) ||
elif command_exists busybox && busybox mkpasswd --help > /dev/null 2>&1; then password_hash=$(busybox mkpasswd -m sha256 "$password" 2> /dev/null) || {
password_hash=$(busybox mkpasswd -m sha256 "$password") for python in python3 python python2; do
else password_hash=$("$python" -c 'import crypt, sys; print(crypt.crypt(sys.argv[1], crypt.mksalt(crypt.METHOD_SHA256)))' "$password" 2> /dev/null) && break
for python in python3 python python2; do python=$(command -v "$python") && break; done done
password_hash=$("$python" -c 'import crypt, sys; print(crypt.crypt(sys.argv[1], crypt.mksalt(crypt.METHOD_SHA256)))' "$password" 2> /dev/null) || password_hash= }
fi
$save_preseed << 'EOF' $save_preseed << 'EOF'

Loading…
Cancel
Save