You've already forked debian-unattended
added ability to run script unattended (pass ROOT_PASSWORD variable from outside environment)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user