Skip to content

Instantly share code, notes, and snippets.

@dewey
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dewey/9346561 to your computer and use it in GitHub Desktop.
Save dewey/9346561 to your computer and use it in GitHub Desktop.
fixcookies.sh
#!/bin/bash
#title : fixcookies.sh
#description : Replace cookie file if pywhatauto breaks it
#author : dewey
#date : 04.03.2014
md5sum=$(which md5sum)
COOKIEDIRECTORY="/home/dewey/pywhatauto/cookies"
if [ -e "$COOKIEDIRECTORY" ]; then
hashcookie=$(md5sum -- "$COOKIEDIRECTORY/broadcasthenet.cookie" | awk '{print $1}')
hashcookiewrong=$(md5sum -- "$COOKIEDIRECTORY/broadcasthenet.cookie.fixed" | awk '{print $1}')
if [ "$hashcookie" != "$hashcookiewrong" ]
then
cp $COOKIEDIRECTORY/broadcasthenet.cookie.fixed $COOKIEDIRECTORY/broadcasthenet.cookie
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment