diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2006-08-24 09:23:38 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2006-08-24 09:23:38 +0000 |
commit | 6c9cdf665dcf2df024a9d5b1fdd7f22d7d17c0db (patch) | |
tree | fa6f690c1fdd3e508ecc6ae07d9d9a4e61d0bfed | |
parent | a9cc6e9eff50c447be1a3bbd190ba9714cac2e2c (diff) | |
download | sitesummary-6c9cdf665dcf2df024a9d5b1fdd7f22d7d17c0db.tar.gz sitesummary-6c9cdf665dcf2df024a9d5b1fdd7f22d7d17c0db.tar.bz2 sitesummary-6c9cdf665dcf2df024a9d5b1fdd7f22d7d17c0db.tar.xz |
Draft for GPG handling.
-rw-r--r-- | sitesummary-client | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/sitesummary-client b/sitesummary-client index de31f66..0cf2438 100644 --- a/sitesummary-client +++ b/sitesummary-client @@ -21,6 +21,21 @@ log() { logger -p user.info -t sitesummary-client "$msg" } +# Check or get GPG key, return false if it is unavailable +get_gpg_key_if_missing() { + true +} +gpg_encrypt_for_url() { + url="$1" + infile="$2" + outfile="$2" + + return + + GPGOPTS="--no-default-keyring --keyring $urlkeyring" + gpg $GPGOPTS -e $infile > $outfile +} + # Read the package default [ -f /usr/share/sitesummary/config ] && . /usr/share/sitesummary/config for confdir in \ @@ -42,12 +57,20 @@ for fragdir in $fragdirs ; do done done -tar zcf $tmpdir.tar.gz . +# Wrap up the package +hostsummaryfile=$tmpdir.tar.gz +tar zcf $hostsummaryfile . + for url in $serverurls ; do -#WGETOPTS="--no-check-certificate" - if wget -q $WGETOPTS --post-file $tmpdir.tar.gz -O $tmpdir.result $url ; then - : + #WGETOPTS="--no-check-certificate" + if get_gpg_key_if_missing $url ; then + gpg_encrypt_for_url $url $hostsummaryfile $hostsummaryfile.gpg + if wget -q $WGETOPTS --post-file $hostsummaryfile.gpg -O $tmpdir.result $url ; then + : + else + log "error: unable to submit to '$url'" + fi else - log "error: unable to submit to '$url'" + log "error: gpg key for '$url' is unavailable. refusing to submit." fi done |