#!/bin/sh UPROOT=~/Upload #TARGET=incoming:/incoming/Sisyphus/BTE/ TARGET=incoming:/incoming/Sisyphus/ MAINTAINER=mike@osdn.org.ua SUBJ1="upload failed" SUBJ2="gpg sig failed" #. ~/.ssh/ssh-agent.sh 2>/dev/null 1>&2 #ssh-add #LC_ALL=C sisyphus_check "$UPROOT/BTE/" || exit 1 [ -z "$UPROOT/BTE/*src.rpm" ] && exit 0 for i in $UPROOT/BTE/*src.rpm; do rpm --checksig $i | grep -q gpg || { # echo "$i: GPG signature missing/invalid" | mail -s "$SUBJ2" $MAINTAINER echo "$i: GPG signature missing/invalid, skipping!" >&2 continue } /usr/bin/rsync $* -avut --partial --stats \ -e ssh $i $TARGET \ >> $UPROOT/rsync-upload.log 2>&1 \ && mv $i $UPROOT/done \ || echo "upload failed: $i" | mail -s "$SUBJ1" $MAINTAINER done #ssh-add -D