Solved username bug

This commit is contained in:
Kevin Veen-Birkenbach 2020-04-29 18:59:04 +02:00
parent 3c3db9597c
commit 5d6a396592

View File

@ -10,7 +10,7 @@ echo
echo "Starting setup..." echo "Starting setup..."
echo "Define working folder..." echo "Define working folder..."
working_folder="/tmp/raspberry-pi-tools-$(date +%s)"; #Working folder working_folder="/tmp/raspberry-pi-tools-$(date +%s)";
echo "Create temporary working folder in $working_folder"; echo "Create temporary working folder in $working_folder";
@ -24,10 +24,10 @@ 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 && echo "User $origin_username doesn't exist. Abord program." && exit 1; getent passwd "$origin_username" > /dev/null 2 || echo "User $origin_username doesn't exist. Abord program." && exit 1;
origin_user_home="/home/$origin_username/"; origin_user_home="/home/$origin_username/";
# Create image folders echo "Image routine starts..."
image_folder="$origin_user_home/Images/"; image_folder="$origin_user_home/Images/";
echo "The images will be stored in \"$image_folder\"." echo "The images will be stored in \"$image_folder\"."
if [ ! -d "$DIR" ]; then if [ ! -d "$DIR" ]; then