Created
March 26, 2015 21:00
-
-
Save jennyq/45de71a93cff774c593d to your computer and use it in GitHub Desktop.
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 | |
if [[ "$OSTYPE" == "linux-gnu" ]]; then | |
# linux | |
sed -i "s|SECRET_KEY='.*'$|SECRET_KEY='$(mcookie)'|" conf/local_settings.py | |
sed -i "s|SITE_SETTINGS_KEY='.*'$|SITE_SETTINGS_KEY='$(mcookie)'|" conf/local_settings.py | |
elif [[ "$OSTYPE" == "darwin"* ]]; then | |
# Mac OSX | |
sed -i bak "s|SECRET_KEY='.*'$|SECRET_KEY='$(date | md5)'|" conf/local_settings.py | |
sed -i bak "s|SITE_SETTINGS_KEY='.*'$|SITE_SETTINGS_KEY='$(date | md5)'|" conf/local_settings.py | |
else | |
echo "Not updated" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment