dots

Personal dotfiles
git clone git://git.gormless.xyz/dots.git
Log | Files | Refs

cockload (551B)


      1 #!/bin/sh
      2 
      3 [ -z "$1" ] && { echo "Please select a file or URL to upload"; exit; }
      4 
      5 case $1 in
      6 	http*|gopher*)
      7 		curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g" | cut -c 1-64)" && curl -i -F files[]=@"/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g" | cut -c 1-64)" https://cockfile.com/upload.php > /tmp/cockload
      8 		grep url /tmp/cockload | cut -c21- | sed 's/\\//g' | sed 's/..$//'
      9 	;;
     10 	*)
     11 		curl -i -F files[]=@"$1" https://cockfile.com/upload.php > /tmp/cockload
     12 		grep url /tmp/cockload | cut -c21- | sed 's/\\//g' | sed 's/..$//'
     13 	;;
     14 esac