Created
March 5, 2014 09:58
-
-
Save VuokkoVuorinnen/9364417 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/sh | |
set -e | |
# copy pasted it from debian package, dont think this is necessary | |
#if [ "$1" = "configure" ]; then | |
# Generate secrets | |
if [ ! -f /var/lib/simplesamlphp/secrets.inc.php ]; then | |
touch /var/lib/simplesamlphp/secrets.inc.php | |
chgrp apache /var/lib/simplesamlphp/secrets.inc.php | |
chmod 640 /var/lib/simplesamlphp/secrets.inc.php | |
ADMINP=`tr -c -d '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' </dev/urandom | dd bs=8 count=1 2>/dev/null`; | |
SSALT=`tr -c -d '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' </dev/urandom | dd bs=32 count=1 2>/dev/null`; | |
printf "<?php\n\$config['auth.adminpassword'] = '%s';\n\$config['secretsalt'] = '%s';\n" \ | |
$ADMINP $SSALT \ | |
>> /var/lib/simplesamlphp/secrets.inc.php | |
fi | |
#fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment