mirror of
https://github.com/kevinveenbirkenbach/linux-image-manager.git
synced 2024-11-21 22:51:05 +01:00
This commit is contained in:
parent
265e5c6f20
commit
796028670f
@ -409,41 +409,35 @@ if [ "$distribution" != "manjaro" ]
|
|||||||
|
|
||||||
copy_resolve_conf
|
copy_resolve_conf
|
||||||
|
|
||||||
question "Should the password of the standart user \"$target_username\" be changed?(y/N)" && read -r change_password
|
question "Type in new password (leave empty to skip): " && read -r password_1
|
||||||
if [ "$change_password" == "y" ]
|
|
||||||
then
|
if [ -n "$password_1" ]; then
|
||||||
|
question "Repeat new password for \"$target_username\": " && read -r password_2
|
||||||
|
if [ "$password_1" = "$password_2" ]; then
|
||||||
info "Changing passwords on target system..."
|
info "Changing passwords on target system..."
|
||||||
question "Type in new password: " && read -r password_1
|
(
|
||||||
question "Repeat new password\"$target_username\"" && read -r password_2
|
echo "$password_1" | chroot "$root_mount_path" passwd --stdin "$target_username"
|
||||||
if [ "$password_1" = "$password_2" ]
|
echo "$password_1" | chroot "$root_mount_path" passwd --stdin
|
||||||
then
|
) || error "Failed to change password."
|
||||||
(
|
|
||||||
echo "(
|
|
||||||
echo '$password_1'
|
|
||||||
echo '$password_1'
|
|
||||||
) | passwd $target_username"
|
|
||||||
echo "(
|
|
||||||
echo '$password_1'
|
|
||||||
echo '$password_1'
|
|
||||||
) | passwd"
|
|
||||||
) | chroot "$root_mount_path" /bin/bash || error
|
|
||||||
else
|
|
||||||
error "Passwords didn't match."
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
info "Skipped password change..."
|
error "Passwords didn't match."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
info "No password change requested, skipped password change..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
hostname_path="$root_mount_path""etc/hostname"
|
|
||||||
question "Should the hostname be changed?(y/N)" && read -r change_hostname
|
hostname_path="$root_mount_path/etc/hostname"
|
||||||
if [ "$change_hostname" == "y" ]
|
|
||||||
then
|
question "Type in the hostname (leave empty to skip): " && read -r target_hostname
|
||||||
question "Type in the hostname:" && read -r target_hostname;
|
|
||||||
echo "$target_hostname" > "$hostname_path" || error
|
if [ -n "$target_hostname" ]; then
|
||||||
else
|
echo "$target_hostname" > "$hostname_path" || error "Failed to set hostname."
|
||||||
target_hostname=$(cat "$hostname_path")
|
else
|
||||||
info "Skipped hostname change..."
|
target_hostname=$(cat "$hostname_path")
|
||||||
|
info "No hostname change requested, skipped hostname change..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
info "Used hostname is: $target_hostname"
|
info "Used hostname is: $target_hostname"
|
||||||
|
|
||||||
case "$distribution" in
|
case "$distribution" in
|
||||||
|
Loading…
Reference in New Issue
Block a user