mirror of
https://github.com/kevinveenbirkenbach/raspberry-pi-tools.git
synced 2024-11-26 11:51:03 +01:00
Solved username bug
This commit is contained in:
parent
3c3db9597c
commit
5d6a396592
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user