#!/bin/bash # show zenity dialog to enter password and mount encrypted folder # sh -c "/usr/bin/zenity --password --title="GoCryptFS" | /usr/bin/gocryptfs -q .gocryptfs/ Chr_decrypt/" action=$1 case "$action" in mount) if [ -e /home/christoph/Chr_decrypt/gocryptfs_Chr_decrypted ]; then echo "already mounted" else echo "mounting .." /usr/bin/zenity --password --title="GoCryptFS" | /usr/bin/gocryptfs -q .gocryptfs/ Chr_decrypt/ fi ;; umount) if [ -e /home/christoph/Chr_decrypt/gocryptfs_Chr_decrypted ]; then echo "unmounting ..." fusermount -u /home/christoph/Chr_decrypt else echo "already unmounted" fi ;; *) echo "Command unknown!" ;; esac