Advertisement
tonybaldwin

bash pastebin script

Jun 23rd, 2011
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.81 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # script to send text to pastebin.com
  4. read -p "username:  " un
  5. read -sp "password:  " pw
  6. read -p "paste title: " pname
  7. read -p "format (code type): " format
  8.  
  9. uk=$(curl -d api_dev_key="dc9d95e68d7db0549edf6131d5233804" -d api_user_name="$un" -d api_user_password="$pw" http://pastebin.com/api/api_login.php)
  10.  
  11. if [[ $1 = "list" ]];
  12.     then
  13.         curl -d api_dev_key="dc9d95e68d7db0549edf6131d5233804" -d api_user_key="$uk" -d api_user_name="$un" -d api_user_password="$pw" -d api_option="list" http://pastebin.com/api/api_post.php
  14.     else
  15.         pc=$(cat $1)
  16.     curl -d api_dev_key="dc9d95e68d7db0549edf6131d5233804" -d api_user_key="$uk" -d api_user_name="$un" -d api_user_password="$pw" -d api_option="paste" -d api_paste_code="$pc" -d api_paste_name="$pname" -d api_paste_format="$format" http://pastebin.com/api/api_post.php
  17. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement