2 #############################################################
3 # gEncFS 0.2 (Harvie 2oo8-2oo9) #
4 # BASH & zenity GUI frontend for mounting EncFS filesystems #
5 #############################################################
7 zenity
="/usr/bin/zenity";
8 gksu
="/usr/bin/gksu"; #path to gksu or gksudo (doesn't matter)
9 encfs
="/usr/bin/encfs";
11 cut
="/bin/cut"; #Arch: /bin/cut vs. Debian: /usr/bin/cut
14 cut
=$
(which cut
); #maybe bit insecure - for compatibility
18 #zenity - insecure way
19 #$zenity --entry --hide-text --text "$(echo -ne "Please enter EncFS password for $1\n$2")" --title "gEncFS: Password for $1" 2>/dev/null;
20 #gksu/gksudo - secure way (grabs keyboard!)
21 gksu
-p -m "$(echo -ne "Please enter EncFS password
for $1\n$2")" 2>/dev
/null
;
25 echo -e "\n\nList of mouted FUSE filesystems:";
26 $cat /etc
/mtab |
$grep "^\(fuse\|encfs\) " |
$cut -d ' ' -f 2;
30 errout
=$
(gencfs_getpass
"$1" "$3" |
$encfs "--extpass=$cat" "$1" "$2")
32 $zenity --question --text "$errout\n\nTry again?" --title "gEncFS: Try again?";
41 if [ -d "$1" ]; then echo -n; else
42 $zenity --error --title "gEncFS: Error!" --text\
43 "Directory $1 doesn't exist.\nYou have to create it manualy by encfs command:\n\nencfs [options] rootDir mountPoint [-- [FUSE Mount Options]]";
51 $zenity --question --text "Do you want to (re)mount\n$1 to $2 ?$(gencfs_fuses;)" --title gEncFS
56 fuseout
=$
(fusermount
-u "$2" 2>&1)
63 gencfs_mount
"$1" "$2" "$fuseout";