#!/bin/bash

mkdir $HOME/virtual-drives/

OPENFILE=`cat $HOME/acetonesm`

rm $HOME/acetonesm

if test -w "$OPENFILE"
then
kdialog --caption "AcetoneISO2" --msgbox "Nothing to do here\nFolder was allready Umounted"
exit
else
echo continua
fi

if test ! -e /usr/bin/fusermount
then
kdialog --caption "AcetoneISO2" --error "Sorry, please run 'compatibility' test in the main program before proceeding"
exit
else
echo continua
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\nPlease be sure the folder has been mounted with AcetoneISO2 or with Service Menu of AcetoneISO2 software"
fi
exit