diff --git a/unattended.sh b/unattended.sh index f400202..072cc99 100755 --- a/unattended.sh +++ b/unattended.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash # Get password from user prompt and set it in preseed -read -sp "Enter the root password: " ROOT_PASSWORD +if [ -z "$ROOT_PASSWORD" ]; then + read -sp "Enter the root password: " ROOT_PASSWORD +fi cp -f template.cfg preseed.cfg sed -i "s/ROOT_PASSWORD/${ROOT_PASSWORD}/" preseed.cfg