RcrdBrt

Untitled

Dec 23rd, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. file=$(mktemp ~/web/paste/XXXXXX)
  4.  
  5. [[ ! -z "$1" ]] && lang="-s $1"
  6.  
  7. cat - > ${file}.in
  8. source-highlight -i ${file}.in -o ${file} ${lang}
  9. rm ${file}.in
  10.  
  11. lftp -e "put -O /dir/to/paste ${file}; bye" \
  12. -u user,password sftp://example.com
  13.  
  14. echo "http://example.com/paste/${file##*/}"
Advertisement
Add Comment
Please, Sign In to add comment