mirror of
https://github.com/kevinveenbirkenbach/raspberry-pi-tools.git
synced 2024-11-26 11:51:03 +01:00
Changed read orders for better readability
This commit is contained in:
parent
30f1d3e021
commit
ee661b2f1f
19
sd_setup.sh
19
sd_setup.sh
@ -40,8 +40,7 @@ if [ "$(id -u)" != "0" ];then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Configure user..."
|
echo "Configure user..."
|
||||||
echo "Please type in a valid username from which the SSH-Key should be copied:"
|
echo "Please type in a valid username from which the SSH-Key should be copied:" && read -r origin_username;
|
||||||
read -r origin_username;
|
|
||||||
getent passwd "$origin_username" > /dev/null 2 || error "User $origin_username doesn't exist.";
|
getent passwd "$origin_username" > /dev/null 2 || error "User $origin_username doesn't exist.";
|
||||||
origin_user_home="/home/$origin_username/";
|
origin_user_home="/home/$origin_username/";
|
||||||
|
|
||||||
@ -60,13 +59,11 @@ echo
|
|||||||
while [ ! -b "$sd_card_path" ]
|
while [ ! -b "$sd_card_path" ]
|
||||||
do
|
do
|
||||||
echo "Please type in the name of the correct sd-card."
|
echo "Please type in the name of the correct sd-card."
|
||||||
echo "/dev/:"
|
echo "/dev/:" && read -r device
|
||||||
read -r device
|
|
||||||
sd_card_path="/dev/$device"
|
sd_card_path="/dev/$device"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Select which Raspberry Pi version should be used"
|
echo "Select which Raspberry Pi version should be used:" && read -r version
|
||||||
read -r version
|
|
||||||
|
|
||||||
echo "Select which operation system should be used..."
|
echo "Select which operation system should be used..."
|
||||||
echo
|
echo
|
||||||
@ -74,9 +71,7 @@ echo "1) arch"
|
|||||||
echo "2) moode"
|
echo "2) moode"
|
||||||
echo "3) retropie"
|
echo "3) retropie"
|
||||||
echo
|
echo
|
||||||
echo "Please type in the os:"
|
echo "Please type in the os:" && read -r os
|
||||||
read -r os
|
|
||||||
|
|
||||||
|
|
||||||
os_does_not_support_raspberry_version_error () {
|
os_does_not_support_raspberry_version_error () {
|
||||||
error "$os for Raspberry Pi Version $version is not supported!";
|
error "$os for Raspberry Pi Version $version is not supported!";
|
||||||
@ -177,8 +172,7 @@ mount_partitions(){
|
|||||||
echo "The following mounts refering this setup exist:" && mount | grep "$working_folder"
|
echo "The following mounts refering this setup exist:" && mount | grep "$working_folder"
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Should the image be transfered to $sd_card_path?(y/n)"
|
echo "Should the image be transfered to $sd_card_path?(y/n)" && read -r transfer_image
|
||||||
read -r transfer_image
|
|
||||||
if [ "$transfer_image" = "y" ]
|
if [ "$transfer_image" = "y" ]
|
||||||
then
|
then
|
||||||
echo "Starting image transfer..."
|
echo "Starting image transfer..."
|
||||||
@ -270,8 +264,7 @@ echo "Change password of user \"$target_username\"..."
|
|||||||
echo "Change password of root user..."
|
echo "Change password of root user..."
|
||||||
(chroot "$root_mount_path" /bin/passwd root) || error "Password change for \"root\" wasn't possible."
|
(chroot "$root_mount_path" /bin/passwd root) || error "Password change for \"root\" wasn't possible."
|
||||||
|
|
||||||
echo "Do you want to copy all Wifi passwords to the sd-card?(y/n)"
|
echo "Do you want to copy all Wifi passwords to the sd-card?(y/n)" && read -r copy_wifi
|
||||||
read -r copy_wifi
|
|
||||||
if [ "$copy_wifi" = "y" ]
|
if [ "$copy_wifi" = "y" ]
|
||||||
then
|
then
|
||||||
origin_wifi_config_path="/etc/NetworkManager/system-connections/"
|
origin_wifi_config_path="/etc/NetworkManager/system-connections/"
|
||||||
|
Loading…
Reference in New Issue
Block a user