I create small script to mount encfs filesystem. just like this:
#!/bin/bash
kdialog --password "Wprowadź hasło do SSH lub ENTER żeby rozłączyć:" > /home/maciek/Pobrane/pass-1
sudo encfs -S --public /home/maciek/dir/.dir_c /home/maciek/dir_v < /home/maciek/Pobrane/pass-1
status=$?
if test $status -eq 0
then
cat /dev/null > /home/maciek/Pobrane/pass-1
<command_A>
kdialog --passivepopup "Zamontowano SSH" 5
exit
else
cat /dev/null > /home/maciek/Pobrane/pass-1
<command_B>
kdialog --passivepopup "Rozłączono SSH lub błędne hasło" 5
fi
It works OK, when running from terminal as ordinary user or as root. Than I create shortcut on my KDE desktop to run that script. And I have to use option "Run in terminal" in shortcut definition because in other case "encfs" does not mount filesys, because of wrong password. But the password was entered correctly. What I im doing wrong so script works properly only started from "konsole" terminal in KDE?