SHARE
TWEET

Untitled

a guest Dec 13th, 2016 32 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. #
  4. # Generated onMon Dec 12 22:54:01 PST 2016# Start of user configurable variables
  5. #
  6. LANG=C
  7. export LANG
  8.  
  9. # SSO username and password
  10. read -p 'SSO User Name:' SSO_USERNAME
  11. read -sp 'SSO Password:' SSO_PASSWORD
  12.  
  13.  
  14. # Path to wget command
  15. WGET=/usr/bin/wget
  16. # Location of cookie file
  17. COOKIE_FILE=/tmp/$$.cookies
  18.  
  19. # Log directory and file
  20. LOGDIR=.
  21. LOGFILE=$LOGDIR/wgetlog-`date +%m-%d-%y-%H:%M`.log
  22. # Output directory and file
  23. OUTPUT_DIR=.
  24. #
  25. # End of user configurable variable
  26. #
  27.  
  28. if [ "$SSO_PASSWORD " = " " ]
  29. then
  30.  echo "Please edit script and set SSO_PASSWORD"
  31.  exit
  32. fi
  33.  
  34. # Contact osdc site so that we can get SSO Params for logging in
  35. SSO_RESPONSE=`$WGET --user-agent="Mozilla/5.0" --no-check-certificate https://edelivery.oracle.com/osdc/faces/SearchSoftware 2>&1|grep Location`
  36.  
  37. # Extract request parameters for SSO
  38. SSO_TOKEN=`echo $SSO_RESPONSE| cut -d '=' -f 2|cut -d ' ' -f 1`
  39. SSO_SERVER=`echo $SSO_RESPONSE| cut -d ' ' -f 2|cut -d '/' -f 1,2,3`
  40. SSO_AUTH_URL=/sso/auth
  41. AUTH_DATA="ssousername=$SSO_USERNAME&password=$SSO_PASSWORD&site2pstoretoken=$SSO_TOKEN"
  42.  
  43. # The following command to authenticate uses HTTPS. This will work only if the wget in the environment
  44. # where this script will be executed was compiled with OpenSSL. Remove the --secure-protocol option
  45. # if wget was not compiled with OpenSSL
  46. # Depending on the preference, the other options are --secure-protocol= auto|SSLv2|SSLv3|TLSv1
  47. $WGET --user-agent="Mozilla/5.0" --secure-protocol=auto --post-data $AUTH_DATA --save-cookies=$COOKIE_FILE --keep-session-cookies $SSO_SERVER$SSO_AUTH_URL -O sso.out >> $LOGFILE 2>&1
  48.  
  49. rm -f sso.out
  50.  
  51.  
  52.  
  53.  
  54.   $WGET  --user-agent="Mozilla/5.0" --no-check-certificate --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies "https://edelivery.oracle.com/osdc/download?fileName=V76291-01_1of4.zip&token=citsOC9wSTlIQnJ6elF0VVpOYVFjdyE6OiF1c2VybmFtZT1FUEQtQUJISVNIRUsuUC5LVU1BUkBBQ0NFTlRVUkUuQ09NJnVzZXJJZD02MTg1NTAyJmNhbGxlcj1TZWFyY2hTb2Z0d2FyZSZjb3VudHJ5SWQ9SU4mZW1haWxBZGRyZXNzPWFiaGlzaGVrLnAua3VtYXJAYWNjZW50dXJlLmNvbSZmaWxlSWQ9Nzk3NjcyNTMmYXJ1PTE4OTMwNzcyJmFncmVlbWVudElkPTI0NTA1ODAmc29mdHdhcmVDaWRzPTIzNTEwNyZwbGF0Zm9ybUNpZHM9MzUmcHJvZmlsZUluc3RhbmNlQ2lkPTU3NzIxNyZkb3dubG9hZFNvdXJjZT13Z2V0JnByb2ZpbGVJbnN0YW5jZU5hbWU9T3JhY2xlIEJ1c2luZXNzIEludGVsbGlnZW5jZSBBcHBsaWNhdGlvbnMgNy45LjYuNC4wIGZvciBMaW51eCB4ODYtNjQmcGxhdGZvcm1OYW1lPUxpbnV4IHg4Ni02NCZtZWRpYUNpZD0zNzQ3NTgmcmVsZWFzZUNpZD0maXNSZWxlYXNlU2VhcmNoPWZhbHNl" -O $OUTPUT_DIR/V76291-01_1of4.zip >> $LOGFILE 2>&1
  55.  
  56.  
  57.  
  58.   $WGET  --user-agent="Mozilla/5.0" --no-check-certificate --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies "https://edelivery.oracle.com/osdc/download?fileName=V76291-01_2of4.zip&token=NEVvQlFkSmtWL3psNFB1STJhWnZEZyE6OiF1c2VybmFtZT1FUEQtQUJISVNIRUsuUC5LVU1BUkBBQ0NFTlRVUkUuQ09NJnVzZXJJZD02MTg1NTAyJmNhbGxlcj1TZWFyY2hTb2Z0d2FyZSZjb3VudHJ5SWQ9SU4mZW1haWxBZGRyZXNzPWFiaGlzaGVrLnAua3VtYXJAYWNjZW50dXJlLmNvbSZmaWxlSWQ9Nzk3NjcyNTQmYXJ1PTE4OTMwNzcyJmFncmVlbWVudElkPTI0NTA1ODAmc29mdHdhcmVDaWRzPTIzNTEwNyZwbGF0Zm9ybUNpZHM9MzUmcHJvZmlsZUluc3RhbmNlQ2lkPTU3NzIxNyZkb3dubG9hZFNvdXJjZT13Z2V0JnByb2ZpbGVJbnN0YW5jZU5hbWU9T3JhY2xlIEJ1c2luZXNzIEludGVsbGlnZW5jZSBBcHBsaWNhdGlvbnMgNy45LjYuNC4wIGZvciBMaW51eCB4ODYtNjQmcGxhdGZvcm1OYW1lPUxpbnV4IHg4Ni02NCZtZWRpYUNpZD0zNzQ3NTgmcmVsZWFzZUNpZD0maXNSZWxlYXNlU2VhcmNoPWZhbHNl" -O $OUTPUT_DIR/V76291-01_2of4.zip >> $LOGFILE 2>&1
  59.  
  60.  
  61.  
  62.   $WGET  --user-agent="Mozilla/5.0" --no-check-certificate --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies "https://edelivery.oracle.com/osdc/download?fileName=V76291-01_3of4.zip&token=TkpFUXNRTnB1cXgzcnR6cnVhK2c1ZyE6OiF1c2VybmFtZT1FUEQtQUJISVNIRUsuUC5LVU1BUkBBQ0NFTlRVUkUuQ09NJnVzZXJJZD02MTg1NTAyJmNhbGxlcj1TZWFyY2hTb2Z0d2FyZSZjb3VudHJ5SWQ9SU4mZW1haWxBZGRyZXNzPWFiaGlzaGVrLnAua3VtYXJAYWNjZW50dXJlLmNvbSZmaWxlSWQ9Nzk3NjcyNzkmYXJ1PTE4OTMwNzcyJmFncmVlbWVudElkPTI0NTA1ODAmc29mdHdhcmVDaWRzPTIzNTEwNyZwbGF0Zm9ybUNpZHM9MzUmcHJvZmlsZUluc3RhbmNlQ2lkPTU3NzIxNyZkb3dubG9hZFNvdXJjZT13Z2V0JnByb2ZpbGVJbnN0YW5jZU5hbWU9T3JhY2xlIEJ1c2luZXNzIEludGVsbGlnZW5jZSBBcHBsaWNhdGlvbnMgNy45LjYuNC4wIGZvciBMaW51eCB4ODYtNjQmcGxhdGZvcm1OYW1lPUxpbnV4IHg4Ni02NCZtZWRpYUNpZD0zNzQ3NTgmcmVsZWFzZUNpZD0maXNSZWxlYXNlU2VhcmNoPWZhbHNl" -O $OUTPUT_DIR/V76291-01_3of4.zip >> $LOGFILE 2>&1
  63.  
  64.  
  65.  
  66.   $WGET  --user-agent="Mozilla/5.0" --no-check-certificate --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies "https://edelivery.oracle.com/osdc/download?fileName=V76291-01_4of4.zip&token=Z3FHNHRFRHovU25Mb2JYOW5YeWo1ZyE6OiF1c2VybmFtZT1FUEQtQUJISVNIRUsuUC5LVU1BUkBBQ0NFTlRVUkUuQ09NJnVzZXJJZD02MTg1NTAyJmNhbGxlcj1TZWFyY2hTb2Z0d2FyZSZjb3VudHJ5SWQ9SU4mZW1haWxBZGRyZXNzPWFiaGlzaGVrLnAua3VtYXJAYWNjZW50dXJlLmNvbSZmaWxlSWQ9Nzk3NjcyODAmYXJ1PTE4OTMwNzcyJmFncmVlbWVudElkPTI0NTA1ODAmc29mdHdhcmVDaWRzPTIzNTEwNyZwbGF0Zm9ybUNpZHM9MzUmcHJvZmlsZUluc3RhbmNlQ2lkPTU3NzIxNyZkb3dubG9hZFNvdXJjZT13Z2V0JnByb2ZpbGVJbnN0YW5jZU5hbWU9T3JhY2xlIEJ1c2luZXNzIEludGVsbGlnZW5jZSBBcHBsaWNhdGlvbnMgNy45LjYuNC4wIGZvciBMaW51eCB4ODYtNjQmcGxhdGZvcm1OYW1lPUxpbnV4IHg4Ni02NCZtZWRpYUNpZD0zNzQ3NTgmcmVsZWFzZUNpZD0maXNSZWxlYXNlU2VhcmNoPWZhbHNl" -O $OUTPUT_DIR/V76291-01_4of4.zip >> $LOGFILE 2>&1
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