Sha256: 542872c29d091cc7e95f801256f2e52a15eb0ae2c93e8e810aaec10d22d508a0

Contents?: true

Size: 800 Bytes

Versions: 2

Compression:

Stored size: 800 Bytes

Contents

#! /bin/sh

DEST=<%= @upload_url %>

if [ -z "$FILES" ]
then
        FILES=./*.tar.gz
fi

if [ -n "$CER_PATH" ]
then
        AUTH_KEY="--cert"
        AUTH_VAL="$CER_PATH"
else
        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

        AUTH_KEY="-u"
        AUTH_VAL="\"$RH_USERNAME\":\"$RH_PASSWORD\""
fi

# /tmp/a b/x.pem
# curl --cert /tmp/a\ b/x.pem

mkdir -p done

for f in $FILES
do
  curl -k -vvv -# --fail -F "file=@$f;type=application/vnd.redhat.qpc.tar+tgz" $DEST "$AUTH_KEY" "$AUTH_VAL"
  if [ $? -eq 0 ]; then
    mv $f done/
    echo "Done: $f"
  fi
done
echo "Uploaded files moved to done/ folder"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_inventory_upload-0.9.1 app/views/scripts/uploader.sh.erb
foreman_inventory_upload-0.9.0 app/views/scripts/uploader.sh.erb