Upload all .gif and .jpg files in a directory to textpattern
Save this as a shell script, adjust the first 3 variables and excute. (Note: LOGIN and PASS should be ascii only, or else manually url-encoded)
URL='http://www.mysite.com/textpattern/' LOGIN='simplename' PASS='yourpassword' COOKIE=$(curl -s -D - -d "p_userid=$LOGIN&p_password=$PASS" \ $URL | head -n10 | sed -n 's/^Set\-Cookie\: //p') if [ -z $COOKIE ] then echo "Can't log in." exit 1 else echo "Cookie: "$COOKIE fi for file in $(ls -1|egrep '(gif)|(jpe?g)$') ; do echo "Sending "$file curl -s -H "Cookie: $COOKIE" -F "thefile=@$file" \ -F "event=image" -F "step=image_insert" $URL > /dev/null done
Update: Added rudimentary check wether login is successful and basic progress meter.