Last active
November 8, 2018 01:55
-
-
Save bonelifer/9d12e13b8465c213d2d2 to your computer and use it in GitHub Desktop.
Replace Pandora's old tls fingerprint with new one in pianobar config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## | |
## A simple little shell script that will return the current | |
## fingerprint on the SSL certificate and replace it in | |
## pianobar's config file automatically | |
## | |
## Author: William Jacoby (bonelifer) <> | |
## | |
## Base on the Github Gist by Bob Saska at: https://gist.github.com/r35krag0th/4173333 | |
## | |
## Assign the output of the openssl command to a variable for later use | |
tlsFingerPrint=`openssl s_client -connect tuner.pandora.com:443 < /dev/null 2> /dev/null | \ | |
openssl x509 -noout -fingerprint | tr -d ':' | cut -d'=' -f2` | |
## Debug outpout line | |
## echo "$tlsFingerPrint" | |
## Change this line to point to your pianobar config file | |
file="/home/pi/.config/pianobar/config" | |
## Go ahead and rewrite the tls_fingerprint line in pianobar's config file | |
sed -ie "s/^tls_fingerprint =.*/tls_fingerprint = $tlsFingerPrint/" $file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment