Skip to content

Commit 1518af7

Browse files
Save changes at: 1773426788
1 parent a126378 commit 1518af7

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

base.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# set -eu
33

44
declare HOSTNAME;
5-
declare PASSWORD;
5+
declare PASSWORD_USER;
6+
declare PASSWORD_VOLUMEN;
67
declare VOLUMEN;
78
declare VOLUMEN_ID;
89

@@ -60,23 +61,23 @@ function user_password() {
6061
local confirm
6162
echo "--> Set password for root and the user account."
6263
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
6465
echo
6566
IFS="" read -r -s -p " Confirm your password: " confirm </dev/tty
6667
echo
6768

68-
if [ -z "$PASSWORD" ]; then
69+
if [ -z "$PASSWORD_USER" ]; then
6970
echo "--> Password cannot be empty."
7071
continue
7172
fi
7273

73-
if [ "$PASSWORD" = "$confirm" ]; then
74+
if [ "$PASSWORD_USER" = "$confirm" ]; then
7475
break
7576
fi
7677

7778
echo "--> Passwords do not match. Please try again."
7879
done
79-
PASSWORD=$(openssl passwd -6 "$confirm")
80+
PASSWORD_USER=$(openssl passwd -6 "$confirm")
8081
}
8182

8283
function volumen_password() {
@@ -279,13 +280,13 @@ EOF
279280

280281
function configure_user() {
281282
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"
283284
arch-chroot /mnt sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers
284285

285286
cp /mnt/etc/skel/.bashrc /mnt/root/.bashrc
286287
chmod 0600 /mnt/root/.bashrc
287288
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
289290
}
290291

291292
function configure_grub() {

0 commit comments

Comments
 (0)