Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. #!/bin/bash
  2. ##
  3. ## A simple little shell script that will return the current
  4. ## fingerprint on the SSL certificate and replace it in
  5. ## pianobar's config file automatically
  6. ##
  7. ## Author: William Jacoby (bonelifer) <>
  8. ##
  9. ## Base on the Github Gist by Bob Saska at: https://gist.github.com/r35krag0th/4173333
  10. ##
  11.  
  12. ## Assign the output of the openssl command to a variable for later use
  13. tlsFingerPrint=`openssl s_client -connect tuner.pandora.com:443 < /dev/null 2> /dev/null | \
  14. openssl x509 -noout -fingerprint | tr -d ':' | cut -d'=' -f2`
  15.  
  16. ## Debug outpout line
  17. ## echo "$tlsFingerPrint"
  18.  
  19. ## Change this line to point to your pianobar config file
  20. file="/home/pi/.config/pianobar/config"
  21.  
  22. ## Go ahead and rewrite the tls_fingerprint line in pianobar's config file
  23. sed -ie "s/^tls_fingerprint =.*/tls_fingerprint = $tlsFingerPrint/" $file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement