Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Bash by GaiveR ( 15 years ago )
#!/bin/bash

# description: uploading file to slil.ru and copy link to it on the clipboard
# created: 24.05.2011
# last modified: 24.05.2011
# author: Oleg Montak

if (( $# != 1 )); then
 echo "Using: "
 echo "slil.sh FILENAME"
 exit 1
fi

which curl > /dev/null
if (( $? != 0 )); then
 echo "Could not find curl"
 exit 1
fi

which xclip > /dev/null
if (( $? != 0 )); then
 echo "Could not find xclip"
 exit 1
fi

result=$(curl -i -F file="@$1" zalil.ru/upload/ | grep Location | awk '{print "slil.ru"$2}')

if grep -oE -q "slil.ru/upload/[0-9]+" <<< $result; then
 #echo "all good!"
 xclip -selection clipboard <<< $result
else
 echo "fuck :("
fi

 

Revise this Paste

Parent: 33869
Children: 33873
Your Name: Code Language: