Created
January 24, 2017 21:09
-
-
Save hikilaka/5924a9cffc6706a44534958ffad52314 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -eq 0 ]; then | |
echo "no parameter passed, must pass image to upload" | |
exit 1 | |
fi | |
FILE=$1 | |
POSTURL="http://bacs.bounceme.net/uploads/index.php" | |
COUNTER=0 | |
if [ ! -e "$FILE" ]; then | |
echo "the file '$FILE' does not exist" | |
exit 1 | |
fi | |
if [ ! -f "$FILE" ]; then | |
echo "$FILE is not a regular file" | |
exit 1 | |
fi | |
cp "$FILE" "$COUNTER$FILE" | |
while :; do | |
curl -X POST -F "file1=@$COUNTER$FILE" $POSTURL | |
LAST="$COUNTER$FILE" | |
COUNTER=$((COUNTER+1)) | |
mv "$LAST" "$COUNTER$FILE" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment