sefs
August 1st, 2006, 10:26 AM
Hi all.
Background
----------
I use TrueCrypt and wanted an easier way to mound the drive without typing the long command each time. I initally then set up a bash one liner script that launched in the terminal from a desktop icon. I later discovered zenity and am trying to get a gui like dialog box.
Problem
--------
The script works fine if in the desktop icon i specify "Run in terminal". It does not if i uncheck this box. I would prefer not to see the terminal window at all. What the problem is, is that when I dont specify to run in terminal, then if i enter an incorrect password the script does not loop at all. When ran in the terminal, then on entering an incorrect password then it loops as expected.
Can any of you Gurus tell me whats wrong with the script?
Thanks.
P.S. I am new to this so any help is appreciated.
The script is as follows
#!/bin/sh
# /mnt/hd2/data/tc/lhd3.sh
COUNTER=0
TCSTATUS="Incorrect password or not a TrueCrypt volume."
DIALOGTEXT="Enter your password."
while [[ $COUNTER < 3 ]] && [[ $TCSTATUS == "Incorrect password"* ]] ; do
GETPASSWD=`zenity --title "Password" --entry --hide-text --text "$DIALOGTEXT"`
if [[ ${#GETPASSWD} != 0 ]] ; then
TCSTATUS=`truecrypt /mnt/hd2/datadrive/datadrive /mnt/hd3 -p$GETPASSWD --password-tries 1`
DIALOGTEXT=$TCSTATUS
let COUNTER=COUNTER+1
else
let COUNTER=3
fi
done
Background
----------
I use TrueCrypt and wanted an easier way to mound the drive without typing the long command each time. I initally then set up a bash one liner script that launched in the terminal from a desktop icon. I later discovered zenity and am trying to get a gui like dialog box.
Problem
--------
The script works fine if in the desktop icon i specify "Run in terminal". It does not if i uncheck this box. I would prefer not to see the terminal window at all. What the problem is, is that when I dont specify to run in terminal, then if i enter an incorrect password the script does not loop at all. When ran in the terminal, then on entering an incorrect password then it loops as expected.
Can any of you Gurus tell me whats wrong with the script?
Thanks.
P.S. I am new to this so any help is appreciated.
The script is as follows
#!/bin/sh
# /mnt/hd2/data/tc/lhd3.sh
COUNTER=0
TCSTATUS="Incorrect password or not a TrueCrypt volume."
DIALOGTEXT="Enter your password."
while [[ $COUNTER < 3 ]] && [[ $TCSTATUS == "Incorrect password"* ]] ; do
GETPASSWD=`zenity --title "Password" --entry --hide-text --text "$DIALOGTEXT"`
if [[ ${#GETPASSWD} != 0 ]] ; then
TCSTATUS=`truecrypt /mnt/hd2/datadrive/datadrive /mnt/hd3 -p$GETPASSWD --password-tries 1`
DIALOGTEXT=$TCSTATUS
let COUNTER=COUNTER+1
else
let COUNTER=3
fi
done