the_script_for_anna

From nic, 6 Years ago, written in Plain Text, viewed 837 times.
URL https://anna.fyi/view/1b992007 Embed
Download Paste or View Raw
  1. #!/bin/bash
  2. # annapaste   paste a file to anna's pastebin
  3.  
  4. filename="$1"
  5. title="$2"
  6. [[ -f /tmp/annapastefile.txt ]] && rm  /tmp/annapastefile.txt
  7.  
  8. if [[ "$filename" = "" ]];
  9. then
  10.    while true;
  11.    do
  12.         echo -n "Enter the next line:   "
  13.         read ansread
  14.         [[ "$ansread" = "" ]] && break
  15.         echo $ansread >>/tmp/annapastefile.txt
  16.    done
  17. else
  18.    cp $filename /tmp/annapastefile.txt
  19. fi
  20.  
  21. if [[ "$title" = "" ]];
  22. then
  23.    echo -n "Enter the title:   "
  24.    read  anstitle
  25.         title="$(echo $anstitle|sed 's/"//g')"
  26. fi
  27.  
  28. echo "curl -d title=\"$title\" -d name='anna' -d expire=0 --data-urlencode text@/tmp/annapastefile.txt https://anna.fyi/api/create"
  29. read
  30. curl -d title="$title" -d name='anna' -d expire=0 --data-urlencode text@/tmp/annapastefile.txt https://anna.fyi/api/create
  31.  

Reply to "the_script_for_anna"

Here you can reply to the paste above