#! /bin/sh DEST=<%= @upload_url %> RH_USERNAME=<%= @rh_username %> if [ -z "$RH_USERNAME" ] then IFS= read -rp "Enter username: " RH_USERNAME fi if [ -z "$RH_PASSWORD" ] then IFS= read -rsp "Enter password: " RH_PASSWORD fi if [ -z "$FILES" ] then FILES=./*.tar.gz fi mkdir -p done for f in $FILES do curl -k -vvv -# --fail -F "file=@$f;type=application/vnd.redhat.qpc.tar+tgz" $DEST -u "$RH_USERNAME":"$RH_PASSWORD" if [ $? -eq 0 ]; then mv $f done/ echo "Done: $f" fi done echo "Uploaded files moved to done/ folder"