1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/wordpress/templates/get-xsce-wp-salts.j2

21 lines
471 B
Text
Raw Normal View History

2017-05-27 18:09:50 +00:00
#!/bin/bash
# Get salt constants and write to wp-keys.php
#
# by Tim Moody tim@timmoody.com
DEST=/library/wordpress/wp-keys.php
BACKUP=/library/wordpress/wp-keys.php.BAK
echo '<?php' > $DEST
curl https://api.wordpress.org/secret-key/1.1/salt/ >> $DEST
RC=$?
# if the download of keys failed, revert to previous version
if [ $RC -ne 0 ];then
cp $BACKUP $DEST
else
echo '?>' >> $DEST
chown root:{{ apache_data }} $DEST
chmod 640 $DEST
cp -f $DEST $BACKUP
fi