Advertisement
bueddl

Untitled

Feb 22nd, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.48 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. APIKEY='your-psp-api-key'
  4. KEYFILE='private-key-file.pem'
  5.  
  6. REQ=$(curl -s http://dyndns.powerserverplus.net/${APIKEY}/update-request)
  7. echo ${REQ}
  8. REQUEST_ID=$(echo ${REQ} | sed -r 's/^.*"id":([0-9]+).*$/\1/')
  9.  
  10. MESSAGE="request=${REQUEST_ID}"
  11. SIGNATURE=$(echo -n "${MESSAGE}"    | openssl rsautl -inkey ${KEYFILE} -sign | base64 -w 0 | sed 's/+/%2B/g')
  12. UPDATE=$(curl -s http://dyndns.powerserverplus.net/${APIKEY}/update -d "${MESSAGE}&signature=${SIGNATURE}")
  13. echo ${UPDATE}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement