diff options
| -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  | 
