Optimized upodate process

This commit is contained in:
Kevin Veen-Birkenbach 2020-05-21 20:01:32 +02:00
parent 16d16387f2
commit d6bb5a2d18
2 changed files with 7 additions and 8 deletions

View File

@ -91,7 +91,7 @@ To pase the configuration to the program use this syntax:
#echo "n" # ├── If arch: Should a encrypted setup be used? (y/n)
echo "n" # | Should the image download be forced?(y/n)
echo "n" # | Should the image be transfered to $device_path?(y/n)
echo "n" # ├── Overwrite device before copying? (y/n)
#echo "n" # ├── Overwrite device before copying? (y/n)
echo "n" # | Should the password be changed?(y/N)
#echo "test12345" # ├── The user password_1
#echo "test12345" # ├── The user password_2

View File

@ -342,7 +342,7 @@ if [ "$change_password" == "y" ]
echo '$password_1'
echo '$password_1'
) | passwd"
) | chroot "$root_mount_path" /bin/bash || error "Password change failed."
) | chroot "$root_mount_path" /bin/bash || error
else
error "Passwords didn't match."
fi
@ -354,20 +354,22 @@ question "Should the hostname be changed?(y/N)" && read -r change_hostname
if [ "$change_hostname" == "y" ]
then
question "Type in the hostname:" && read -r hostname;
echo "$hostname" > "$root_mount_path""etc/hostname" || error "Changing hostname failed."
echo "$hostname" > "$root_mount_path""etc/hostname" || error
else
info "Skipped hostname change..."
fi
question "Should the image system be updated?(y/N)" && read -r update_system
question "Should the system be updated?(y/N)" && read -r update_system
if [ "$update_system" == "y" ]
then
info "Updating system..." &&
(
echo "yes | pacman-key --init"
echo "yes | pacman-key --populate archlinuxarm"
echo "yes | pacman -Syyu"
) | chroot "$root_mount_path" /bin/bash || error "Password change failed."
) | chroot "$root_mount_path" /bin/bash || error
fi
# question "Do you want to copy all Wifi passwords to the device?(y/n)" && read -r copy_wifi
# if [ "$copy_wifi" = "y" ]
# then
@ -376,8 +378,5 @@ fi
# rsync -av "$origin_wifi_config_path" "$target_wifi_config_path"
# fi
info "The first level folder structure on $root_mount_path is:" && tree -laL 1 "$root_mount_path"
info "The first level folder structure on $boot_mount_path is:" && tree -laL 1 "$boot_mount_path"
destructor
success "Setup successfull :)" && exit 0