1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Softcode wordpress/templates/get-iiab-wp-salts.j2

This commit is contained in:
A Holt 2020-01-17 22:23:22 -05:00 committed by GitHub
parent b696417ec7
commit be078a9f06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,20 +1,21 @@
#!/bin/bash
# Get salt constants and write to wp-keys.php
# Download 8 dynamically-generated salt/key 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
DEST={{ wp_abs_path }}/wp-keys.php # /library/wordpress
BACKUP={{ wp_abs_path }}/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
if [ $RC -ne 0 ]; then
cp $BACKUP $DEST
else
echo '?>' >> $DEST
chown root:{{ apache_user }} $DEST
chmod 640 $DEST
cp -f $DEST $BACKUP
echo '?>' >> $DEST
chown root:{{ apache_user }} $DEST
chmod 640 $DEST
cp -f $DEST $BACKUP
fi