Optimized upodate process

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

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