dieses kleine ver/entschlüsse script funktioniert wenn ich es aus dem termianl heraus starte:
Code: Alles auswählen
#!/bin/bash
HOMEDIR=$(getent passwd $USER | awk -F: '{print $6}')
echo $HOMEDIR
function DECRYPT
{
local SECRETFILE=`zenity --file-selection --title="Select the file you want to decrypt"`
echo "$SECRETFILE"
case $? in
0)
echo "\"$SECRETFILE\" selected."
local password=`zenity --entry --title="password entry " --hide-text --text="enter password for $SECRETFILE :"`
echo $password | gpg --passphrase-fd 0 -d $SECRETFILE > decryptedfile
FILETYPE=`file decryptedfile | cut -d " " -f 2` # determins the filetype of the decrypted file
#zenity --info --text "$FILETYPE"
#cat decryptedfile
case "$FILETYPE" in
'ASCII')
geany decryptedfile &
;;
'PDF')
acroread decryptedfile &
;;
'JPEG')
eog decryptedfile &
;;
*)
application=`zenity --entry --title="choose application for the decrypted file" --text="enter aplication name:"`
$application decryptedfile
;;
esac
;;
1)
echo "No file selected."
zenity --error --text "you have not selected a file. Go again."
DECRYPT
;;
-1)
echo "No file selected."
zenity --error --text "you have not selected a file. Go again."
DECRYPT
;;
esac
} # end of funktion DECRYPT
function ENCRYPT
{
local SECRETFILE=`zenity --file-selection --title="Select the file you want to encrypt"`
local password=`zenity --entry --title="password entry " --hide-text --text="enter password for $SECRETFILE :"`
#`echo $password | gpg --passphrase-fd 0 -c $SECRETFILE`=$(zenity --file-selection --save --confirm-overwrite)
savepath=$(zenity --file-selection --save --confirm-overwrite)
`echo $password | gpg --output $savepath.gpg --passphrase-fd 0 -c $SECRETFILE`
}
function FUNKTIONSAUSWAHL
{
funktionchoise=$(zenity --list --text "Please choose the action you want to perform:" --radiolist --column "choise" --column "action" TRUE decrypt FALSE encrypt FALSE "end programm");
echo "auswahl: $funktionchoise"
case "${funktionchoise}" in
'decrypt')
DECRYPT
;;
'encrypt' )
ENCRYPT
;;
'end programm' )
exit
;;
* )
exit
;;
esac
} # end of funktion FUNKTIONSAUSWAHL
### MAIN
FUNKTIONSAUSWAHL
Wenn ich das Script im Terminal so aufrufe dann gehts.
Woran kann das liegen?
Danke