diff options
| author | Freya Murphy <freya@freyacat.org> | 2024-06-21 14:11:32 -0400 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2024-06-21 14:11:32 -0400 |
| commit | ec91773b25ee8bd7c3e36031ec0970e7bc30c6bd (patch) | |
| tree | 5ebe7612005cb2e020a57f1a3dacbb332fb86638 /:w | |
| parent | mispelling of UUID from UUId (diff) | |
| download | dotfiles-guix-ec91773b25ee8bd7c3e36031ec0970e7bc30c6bd.tar.gz dotfiles-guix-ec91773b25ee8bd7c3e36031ec0970e7bc30c6bd.tar.bz2 dotfiles-guix-ec91773b25ee8bd7c3e36031ec0970e7bc30c6bd.zip | |
update kaworu and start dotfiles update
Diffstat (limited to ':w')
| -rw-r--r-- | :w | 51 |
1 files changed, 51 insertions, 0 deletions
@@ -0,0 +1,51 @@ +#!/run/current-system/profile/bin/bash + +USER_PASSWORD="" +ROOT_PASSWORD="" + +source ./guix-env +source ./guix-log + +get_root_password() { + read -s -p "Root password: " PASSWORD + printf "\n" + read -s -p "Confirm password: " PASSWORD_CONFIRM + printf "\n" + if [ "$PASSWORD" == "$PASSWORD_CONFIRM" ]; then + ROOT_PASSWORD=$PASSWORD + return + else + ERROR "Passwords do not match" + get_root_password + fi +} + +get_user_password() { + read -s -p "User password: " PASSWORD + printf "\n" + read -s -p "Confirm password: " PASSWORD_CONFIRM + printf "\n" + if [ "$PASSWORD" == "$PASSWORD_CONFIRM" ]; then + USER_PASSWORD=$PASSWORD + return + else + ERROR "Passwords do not match" + get_user_password + fi +} + +EVENT "Setup /etc/shadow for root and user" + +get_root_password +get_user_password + +cat << EOF | chroot /mnt +passwd +$ROOT_PASSWORD +$ROOT_PASSWORD +passwd freya +$USER_PASSWORD +$USER_PASSWORD +EOF + +EVENT "Successfully set passwords" |