Skip to content

Instantly share code, notes, and snippets.

@jennyq
Created March 26, 2015 21:00
Show Gist options
  • Save jennyq/45de71a93cff774c593d to your computer and use it in GitHub Desktop.
Save jennyq/45de71a93cff774c593d to your computer and use it in GitHub Desktop.
#!/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