Shell script not picking up password file...
Posted
by BigDogsBarking
on Stack Overflow
See other posts from Stack Overflow
or by BigDogsBarking
Published on 2010-04-28T12:06:14Z
Indexed on
2010/04/28
16:43 UTC
Read the original article
Hit count: 287
Running the below shell script seems to ignore the password file I'm feeding it. I'm continually prompted for it. If I enter it, the rest of the script goes without a hitch, but as I'm running it via cron, I really need to get it to read from the file... Any suggestions?
#!/bin/sh
p=$(<password.txt)
set -- $p
pass_phrase=$1
destination="/var/www/d"
cd /var/sl/
for FILE in *.pgp;
do
FILENAME=${FILE%.pgp}
gpg --passphrase "$pass_phrase" --output "$destination/$FILENAME" --decrypt "$FILE"
rm -f $FILE
done
© Stack Overflow or respective owner