Created
February 23, 2018 14:33
-
-
Save jamiehoward/3cd828e28a246c8cbdbc0d65b3f18689 to your computer and use it in GitHub Desktop.
Create a symlink for Wordpress config in Laravel Forge
This file contains 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/bash | |
# Tags: wordpress, laravel, forge, env | |
# This script creates a symlink for wp-config.php so that you | |
# can edit it from the Forge user interface by clicking | |
# "Edit Files" (like you would for a Laravel app). | |
# Get a list of sites on the server | |
SITES=$(find /home/forge -maxdepth 1 | grep -v "\/\." | grep "\.") | |
for SITE in ${SITES[@]}; do | |
# Check to see if this has already been done. | |
if [[ ! -f ${SITE}/.env ]]; then | |
# Create the symlink | |
ln -s ${SITE}/public/wp-config.php ${SITE}/.env | |
else | |
echo ${SITE} already has an environment file link. | |
fi | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment