diff --git a/server/modules/local-accounts/opt/openslx/scripts/local-accounts_insert-data.sh b/server/modules/local-accounts/opt/openslx/scripts/local-accounts_insert-data.sh index bb018a3834e7ec80cb8f5f7ea622f1f841af5332..d7d3973b2fc9f9e1c2f0599e8ede20fdfd4390a7 100755 --- a/server/modules/local-accounts/opt/openslx/scripts/local-accounts_insert-data.sh +++ b/server/modules/local-accounts/opt/openslx/scripts/local-accounts_insert-data.sh @@ -59,6 +59,12 @@ dev="$1" prepare_usb "$dev" #returns at $mountpath # will only continue if the device that triggered is a valid openslx device echo "$0: an openslx ready drive is mounted at: $mountpath" +if [ ! -e "/home/openslx/usb_slx" ]; then + mkdir -p "/home/openslx/usb_slx"; +fi +# Create a file that makes sure that this drive is a openslx users +# to be used to umount it +touch "/home/openslx/usb_slx/$dev" unset IFS users=$(cat "$mountpath/Openslx/.config"); diff --git a/server/modules/local-accounts/opt/openslx/scripts/local-accounts_remove-udev.sh b/server/modules/local-accounts/opt/openslx/scripts/local-accounts_remove-udev.sh index bc0707db75fa31384ce3307b99dc2e3aeed5809b..a99f512fc36bbde343a0e516d7b414b563a12c3c 100755 --- a/server/modules/local-accounts/opt/openslx/scripts/local-accounts_remove-udev.sh +++ b/server/modules/local-accounts/opt/openslx/scripts/local-accounts_remove-udev.sh @@ -12,11 +12,13 @@ remove (){ #set -x user_drive="/dev/$1" - + dev=$1 #check if this is a openslx drive mountpath=$(mount | sed 's/ type.*//' | grep -w $dev | cut -d' ' -f3- | head -n1) - if [ -e "$mountpath/Openslx/.config" ]; then + #if [ -e "$mountpath/Openslx/.config" ]; then + if [ -e "/home/openslx/usb_slx/$dev" ]; then echo "$0: /dev/$dev is an openslx ready drive" + rm "/home/openslx/usb_slx/$dev" else echo "$0: /dev/$dev is not ready to be used as an openslx drive" exit 2 # stops openslx users_pendrive execution for this dev