From a88b84669bfd61aa0fc668ba85a91ea26684a7b9 Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Fri, 24 Oct 2025 13:48:59 +0200 Subject: [PATCH] added ability to run script unattended (pass ROOT_PASSWORD variable from outside environment) --- unattended.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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