GnuPG Shell脚本 – 拒绝读取密码

下面的脚本曾经在Mac OS X上运行,但是,由于它将它移动到Ubuntu,它似乎根本没有从密码文件中读取.即使我从命令行运行它,无论我做什么,我都会弹出提示,询问密码.因为这将通过cron运行,我不希望这发生…我希望它从文件中读取密码而没有提示.需要注意的是,我确实尝试过使用passphrase-fd和passphrase-file,但两者都没有…
#!/bin/sh
p=$(<pass.txt)
set -- $p
pass_phrase=$1
destination="/var/www/decrypted"
cd /var/sl_bin/
for FILE in *.pgp;
do
    FILENAME=${FILE%.pgp}
    gpg --passphrase "$pass_phrase" --output "$destination/$FILENAME" --decrypt "$FILE"
    rm -f $FILE
done
这有效:
gpg --no-use-agent --batch --passphrase-file pass.txt --output kkkk.tar.bz2  --decrypt kkk-data.tar.bz2.gpg

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...