From 24747ac06014c40bafa119db5b7b13670fa031e4 Mon Sep 17 00:00:00 2001 From: Bohan Yang Date: Wed, 23 Sep 2020 16:08:19 +0800 Subject: [PATCH] Network console update --- netboot.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/netboot.sh b/netboot.sh index 01d9844..042dad6 100644 --- a/netboot.sh +++ b/netboot.sh @@ -233,11 +233,16 @@ d-i anna/choose_modules string network-console d-i preseed/early_command string anna-install network-console EOF if [ -n "$DEBI_SSH_PASSWORD" ]; then - echo "d-i network-console/password password $DEBI_SSH_PASSWORD" | $save_preseed - echo "d-i network-console/password-again password $DEBI_SSH_PASSWORD" | $save_preseed - fi - if [ -n "$DEBI_SSH_KEYS" ]; then - echo "d-i network-console/authorized_keys_url string $DEBI_SSH_KEYS" | $save_preseed + $save_preseed << EOF +d-i network-console/password-disabled boolean false +d-i network-console/password password $DEBI_SSH_PASSWORD +d-i network-console/password-again password $DEBI_SSH_PASSWORD +EOF + elif [ -n "$DEBI_SSH_KEYS" ]; then + $save_preseed << EOF +d-i network-console/password-disabled boolean true +d-i network-console/authorized_keys_url string $DEBI_SSH_KEYS +EOF fi echo 'd-i network-console/start select Continue' | $save_preseed fi