|
2 | 2 | # set -eu |
3 | 3 |
|
4 | 4 | declare HOSTNAME; |
5 | | -declare PASSWORD; |
| 5 | +declare PASSWORD_USER; |
| 6 | +declare PASSWORD_VOLUMEN; |
6 | 7 | declare VOLUMEN; |
7 | 8 | declare VOLUMEN_ID; |
8 | 9 |
|
@@ -60,23 +61,23 @@ function user_password() { |
60 | 61 | local confirm |
61 | 62 | echo "--> Set password for root and the user account." |
62 | 63 | while true; do |
63 | | - IFS="" read -r -s -p " Enter your password: " PASSWORD </dev/tty |
| 64 | + IFS="" read -r -s -p " Enter your password: " PASSWORD_USER </dev/tty |
64 | 65 | echo |
65 | 66 | IFS="" read -r -s -p " Confirm your password: " confirm </dev/tty |
66 | 67 | echo |
67 | 68 |
|
68 | | - if [ -z "$PASSWORD" ]; then |
| 69 | + if [ -z "$PASSWORD_USER" ]; then |
69 | 70 | echo "--> Password cannot be empty." |
70 | 71 | continue |
71 | 72 | fi |
72 | 73 |
|
73 | | - if [ "$PASSWORD" = "$confirm" ]; then |
| 74 | + if [ "$PASSWORD_USER" = "$confirm" ]; then |
74 | 75 | break |
75 | 76 | fi |
76 | 77 |
|
77 | 78 | echo "--> Passwords do not match. Please try again." |
78 | 79 | done |
79 | | - PASSWORD=$(openssl passwd -6 "$confirm") |
| 80 | + PASSWORD_USER=$(openssl passwd -6 "$confirm") |
80 | 81 | } |
81 | 82 |
|
82 | 83 | function volumen_password() { |
@@ -279,13 +280,13 @@ EOF |
279 | 280 |
|
280 | 281 | function configure_user() { |
281 | 282 | echo "--> Create user." |
282 | | - arch-chroot /mnt useradd --create-home --shell=/bin/bash --gid=users --groups=wheel,uucp,video --password="$PASSWORD" --comment="$USERCOMMENT" "$USERNAME" |
| 283 | + arch-chroot /mnt useradd --create-home --shell=/bin/bash --gid=users --groups=wheel,uucp,video --password="$PASSWORD_USER" --comment="$USERCOMMENT" "$USERNAME" |
283 | 284 | arch-chroot /mnt sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers |
284 | 285 |
|
285 | 286 | cp /mnt/etc/skel/.bashrc /mnt/root/.bashrc |
286 | 287 | chmod 0600 /mnt/root/.bashrc |
287 | 288 | arch-chroot /mnt usermod --shell /bin/bash root |
288 | | - printf "root:%s" "$PASSWORD" | arch-chroot /mnt chpasswd --encrypted |
| 289 | + printf "root:%s" "$PASSWORD_USER" | arch-chroot /mnt chpasswd --encrypted |
289 | 290 | } |
290 | 291 |
|
291 | 292 | function configure_grub() { |
|
0 commit comments