Skip to content

Instantly share code, notes, and snippets.

@bonelifer
Last active November 8, 2018 01:55
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save bonelifer/9d12e13b8465c213d2d2 to your computer and use it in GitHub Desktop.
Replace Pandora's old tls fingerprint with new one in pianobar config
#!/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