--- zenencfs	2016-09-10 14:39:55.000000000 +0200
+++ /usr/bin/zenencfs	2016-09-25 17:53:26.968571345 +0200
@@ -31,7 +31,7 @@
 # We deal with any situation : normal folder, folder with encfs extention, no folder, relative or absolute path ...
 [ "$@" ] && arg="$(dirname "$@"/.)" || arg="$HOME/Private Folder"
 [ ! -e "$arg" ] && mkdir -p "$arg"
-[ ! -d "$arg" ] && $dialog --title "$(eval_gettext 'Not a folder')" --msgbox "$(eval_gettext 'You must provide a folder to process')" 8 65 &&	exit 1
+[ ! -d "$arg" ] && $dialog --title "$(eval_gettext 'Not a folder')" --msgbox "$(eval_gettext 'You must provide a folder to process')" 8 65 &&	exit 0
 
 if [ "$(echo "$arg" | grep "\.encfs$")" ]; then
 	foldernoext="$(basename -s .encfs "$arg")"
@@ -48,30 +48,30 @@
 # case 1 : folder already opened : we may close it
 if [ "$(/bin/mount | grep "^encfs.*$pathtofolder/$foldernoext.*" )" ] ; then
 	$dialog --title "$(eval_gettext 'Closing')" --ok-label "$(eval_gettext 'OK')" --cancel-label "$(eval_gettext 'Cancel')" --yesno "$(eval_gettext 'Closing ENCFS Folder') \"$foldernoext\"" 8 65 
-	[ $? != 0 ] && exit 1
+	[ $? != 0 ] && exit 0
 	mountpoint="$(/bin/mount | grep "^encfs.*$pathtofolder/$foldernoext.*" | sed -n 's|^encfs on \(.*\) type .*|\1|p')"
 	ERROR="$(fusermount -u "$mountpoint" 2>&1)"
-	[ "$ERROR" ] && $dialog --title "$(eval_gettext 'Error')" --msgbox "$ERROR" 8 65 && exit 1
+	[ "$ERROR" ] && $dialog --title "$(eval_gettext 'Error')" --msgbox "$ERROR" 8 65 && exit 0
 	rmdir "$mountpoint"
 
 else
 	if [ -d "$folderext" ]; then
 	# case 2 : folder not opened, but already encrypted : we may open it
 		password="$(${securedialog} "$(eval_gettext 'Opening ENCFS Folder') \"$folderext\"" 12 80)"
-		[ $? != 0 ] && exit 1
-		[ ! "$password" ] && $dialog --title "$(eval_gettext 'Error')" --msgbox "$(eval_gettext 'Empty password')" 8 65 && exit 1
+		[ $? != 0 ] && exit 0
+		[ ! "$password" ] && $dialog --title "$(eval_gettext 'Error')" --msgbox "$(eval_gettext 'Empty password')" 8 65 && exit 0
 		mkdir -p "$foldernoext"
 		echo -n $password |  encfs --standard --stdinpass "$pathtofolder/$folderext" "$pathtofolder/$foldernoext"
 		[ $? != 0 ] && $dialog --title "$(eval_gettext 'Error')" --msgbox "$(eval_gettext 'Error opening folder')" 8 65 && rmdir "$foldernoext"
 	else
 	# case 3 : folder not opened, and not already encrypted : we may create it
 		password="$(${securedialog} "$(eval_gettext 'Creating ENCFS Folder') \"$folderext\"" 12 80)"
-		[ $? != 0 ] && exit 1
-		[ ! "$password" ] && $dialog --title "$(eval_gettext 'Error')" --msgbox "$(eval_gettext 'Empty password')" 8 65 && exit 1
+		[ $? != 0 ] && exit 0
+		[ ! "$password" ] && $dialog --title "$(eval_gettext 'Error')" --msgbox "$(eval_gettext 'Empty password')" 8 65 && exit 0
 		mkdir -p "$folderext"
 		mkdir -p "$foldernoext.TMP"
 		echo -n $password |  encfs --standard --stdinpass "$pathtofolder/$folderext" "$pathtofolder/$foldernoext.TMP"
-		[ $? != 0 ] && $dialog --title "$(eval_gettext 'Error')" --msgbox "$(eval_gettext 'Error creating folder')" 8 65 && rmdir "$foldernoext.TMP" && rmdir "$folderext" && exit 1
+		[ $? != 0 ] && $dialog --title "$(eval_gettext 'Error')" --msgbox "$(eval_gettext 'Error creating folder')" 8 65 && rmdir "$foldernoext.TMP" && rmdir "$folderext" && exit 0
 		if [ -e "$foldernoext"/* ]; then
 			# $dialog --title "$(eval_gettext 'Moving data')" --timeout 5 --msgbox "$(eval_gettext 'Moving data to ENCFS Folder,this may take a while depending on the size of data') \"$folderext\"" 8 65 &
 			cp -rf "$foldernoext"/* "$foldernoext.TMP"
@@ -79,7 +79,7 @@
 		fi
 		mountpoint="$(/bin/mount | grep "^encfs.*$pathtofolder/$foldernoext.*" | sed -n 's|^encfs on \(.*\) type .*|\1|p')"
 		ERROR="$(fusermount -u "$mountpoint" 2>&1)"
-		[ "$ERROR" ] && $dialog --title "$(eval_gettext 'Error')" --msgbox "$ERROR" 8 65 && exit 1
+		[ "$ERROR" ] && $dialog --title "$(eval_gettext 'Error')" --msgbox "$ERROR" 8 65 && exit 0
 		rmdir "$mountpoint"
 		rm -rf "$foldernoext"
 	fi
