-
-
Save centminmod/bbaa3a5dfc78fbb199db193beb7719ee to your computer and use it in GitHub Desktop.
wpinfo.sh for centmin.sh menu option 22
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 | |
#################################################### | |
# curl -4sL https://gist.githubusercontent.com/centminmod/bbaa3a5dfc78fbb199db193beb7719ee/raw/wpinfo-generator.sh | bash -s yourdomain.com | |
#################################################### | |
vhostname=yourdomain.com | |
if [ $1 ]; then | |
vhostname=$1 | |
fi | |
# create /usr/local/nginx/conf/wpincludes/${vhostname}/wpinfo.sh | |
if [ -d "/usr/local/nginx/conf/wpincludes/${vhostname}" ]; then | |
cat > "/usr/local/nginx/conf/wpincludes/${vhostname}/wpinfo.sh" <<EOF | |
#!/bin/bash | |
WPSITE_INSTALLPATH='/home/nginx/domains/${vhostname}/public' | |
cd \$WPSITE_INSTALLPATH; | |
wp cli version --allow-root; | |
echo "WP-Home \$(wp option get home --allow-root)"; | |
echo "WP-SiteURL \$(wp option get siteurl --allow-root)"; | |
wp core version --extra --allow-root | column -t; | |
wp user list --role=administrator --allow-root; | |
wp config list --allow-root; | |
wp plugin list --allow-root; | |
wp theme list --allow-root; | |
EOF | |
chmod +x /usr/local/nginx/conf/wpincludes/${vhostname}/wpinfo.sh | |
else | |
echo "existing wordpress installation not detected" | |
echo "can not find directory at:" | |
echo "/usr/local/nginx/conf/wpincludes/${vhostname}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment