daily pastebin goal
24%
SHARE
TWEET

c@rl@

a guest Feb 7th, 2019 47 in 292 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. while true; do
  4.  
  5.     echo "Enter your Pastebin Developper API Key (see http://pastebin.com/api), or leave blank to use the default one (may not work):"
  6.     read input
  7.  
  8.     if [ -z $input ] ; then
  9.         echo "Trying to obtain default Developper API Key..."
  10.         input=`wget -qO - http://tobast.fr/ressources/pastebin_devkey`
  11.  
  12.         if (( ! `echo $input | grep -ce "[0-9a-f]\{32\}"` > 0 )) ; then
  13.             echo -e "\nERROR: Cannot obtain the default Developper API Key ! Please re-try with your API key.\n"
  14.         else
  15.             break
  16.         fi
  17.     else
  18.         if (( ! `echo $input | grep -ce "[0-9a-f]\{32\}"` > 0 )) ; then
  19.             echo -e "\nERROR: Wrong API key, please re-try.\n"
  20.         else
  21.             break
  22.         fi
  23.     fi
  24. done
  25.  
  26. sed -ire "49s/\"\".*$/\"${input}\"/" data_devcode.h
  27. echo "Success!"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top