mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 19:52:06 +00:00
21 lines
471 B
Text
21 lines
471 B
Text
|
#!/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
|