#!/bin/bash

# smonta una cartella

OPENFILE=`cat $HOME/acetonesm`

rm -rf $HOME/acetonesm

mkdir "$OPENFILE"/test
if test -e "$OPENFILE/test"
then
rm -rf "$OPENFILE"/test
kdialog --caption "AcetoneISO2" --msgbox "Folder is allready Umounted.\nIf it is still mounted, it means the directory doesn't belong to your user."
exit
fi


fusermount -u -z "$OPENFILE"

mkdir "$OPENFILE"/test
if test -e "$OPENFILE"/test
then
rm -rf "$OPENFILE"/test

kdialog --caption "AcetoneISO" --msgbox "Folder Umounted!"
exit
else
kdialog --caption "AcetoneISO" --error "Folder was not Umounted.\nCheck if the directory belongs to your user"
exit
fi
