diff --git a/usb_drive/insert_data.sh b/usb_drive/insert_data.sh index 734225a3b10f09ad46e8f54678956187905695c5..1c347354f464d39892189c012d396a9c66824cdf 100755 --- a/usb_drive/insert_data.sh +++ b/usb_drive/insert_data.sh @@ -65,6 +65,10 @@ if [ -z "$users" ]; then fi set $users +if [ ! -e "/home/openslx/usb_users" ]; then + mkdir -p /home/openslx/usb_users; +fi + # parse config file until EOF while (( [ $# -gt 0 ] )); do # get the respective line for passwd, shadow and group @@ -95,6 +99,8 @@ while (( [ $# -gt 0 ] )); do # because grep will not find anything if [ -n "$localID" ] && [ -n "$localGID" ]; then /opt/openslx/scripts/adduser.sh "$passwdf" "$groupf" "$shadowf" + #Add to a file what pendrive this user is from + echo "$mountpath" > "/home/openslx/usb_users/$username" fi fi done