diff options
author | Erich Eckner <git@eckner.net> | 2019-04-18 10:11:12 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-04-18 10:11:12 +0200 |
commit | 8de957ddcfda8ef87d73a221c0594015134eebe2 (patch) | |
tree | a32338fb9216db9738e0cd6bdefe67f603b75c9e | |
parent | a5a96b1f63c84f32d4fe95f5e6a27f78c43c7519 (diff) | |
download | lo-status-8de957ddcfda8ef87d73a221c0594015134eebe2.tar.xz |
lo-status: allow symmetric encryption
-rwxr-xr-x | lo-status | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -2,13 +2,26 @@ cd "$(dirname "$0")" +if [ -f '/mnt/key/192.168.0.1' ]; then + ${gpg_options}='--passphrase-file /mnt/key/192.168.0.1' +fi + +credentials=$( + gpg -d ${gpg_options} --no-tty --batch -o - credentials.gpg 2>/dev/null +) +err=$? +if [ ${err} -ne 0 ]; then + >&2 echo 'gpg decrypt error' + exit ${err} +fi + curl \ -Ss \ --resolve backup-lo.ddns.eckner.net:443:backup-lo.vpn.ddns.eckner.net:443 \ 'https://backup-lo.ddns.eckner.net/chassis.html' \ --cacert backup-lo.crt \ --digest \ - --user "$(gpg -d -o - credentials.gpg 2>/dev/null)" \ + --user "${credentials}" \ | sed ' s,^.*<TR><TD><STRONG>Power Status:</STRONG></TD><TD>\([^<>]*\)</TD></TR>.*$,\1, t |