Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -
- # SCRIPT: pandora.sh
- # AUTHOR: Luciano D. Cecere
- # YEAR: 2014
- #
- # Connect to pandora service through pianobar
- # Requires pandora account.
- pandora=/usr/bin/pianobar
- pandora_path=~/.config/pianobar
- pandora_username='' # required
- pandora_password='' # required
- if ! which $pandora >/dev/null
- then
- printf "%s\n" "$pandora is not installed" 2>/dev/null
- exit 1
- fi
- if [ ! -d $pandora_path ]
- then
- mkdir -p $pandora_path
- fi
- cd $pandora_path
- if [ ! -f config ]
- then
- touch config
- fi
- if [ ! -p ctl ]
- then
- mkfifo ctl
- chmod 777 ctl
- fi
- if [ -z "$pandora_username" ] || [ -z "$pandora_password" ]
- then
- printf "%s\n" "pandora_username and pandora_password not set" 2>/dev/null
- exit 1
- fi
- tls=$(openssl s_client -connect tuner.pandora.com:443 < /dev/null 2> /dev/null | \
- openssl x509 -noout -fingerprint | tr -d ':' | cut -d'=' -f2)
- echo "tls_fingerprint = $tls" > config
- gnome-terminal --tab -e $pandora
- echo $pandora_username > ctl
- echo $pandora_password > ctl
- # To start pianobar on station 12:
- #echo '12' > ctl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement