added ability to run script unattended (pass ROOT_PASSWORD variable from outside environment)

This commit is contained in:
2025-10-24 13:48:59 +02:00
parent 935aa95ec7
commit a88b84669b

View File

@@ -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