Forked mumble-django project from https://bitbucket.org/Svedrin/mumble-django
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
923 B

  1. #!/bin/bash
  2. #
  3. # Update settings.py with an automatically generated Secret Key.
  4. #
  5. # Copyright © 2009-2010, Michael "Svedrin" Ziegler <diese-addy@funzt-halt.net>
  6. #
  7. # Mumble-Django is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This package is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. HASHSCRIPT='
  18. from hashlib import sha1;
  19. import sys;
  20. print sha1( sys.stdin.read() ).hexdigest();'
  21. KEY=` dd if=/dev/urandom bs=64 count=1 2>/dev/null | python -c "$HASHSCRIPT" `
  22. SECKEY="SECRET_KEY = '$KEY'"
  23. sed -i "s/^SECRET_KEY.*/${SECKEY}/" settings.py