Created
September 26, 2019 12:25
-
-
Save runningman84/25cc03309534fe415fce23221b7accac to your computer and use it in GitHub Desktop.
wp-plugin
This file contains hidden or 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 | |
if [ "$WP_PLUGINS" = "" ] | |
then | |
echo "please define WP_PLUGINS" | |
exit 1 | |
fi | |
cd /app | |
for plugin in $WP_PLUGINS | |
do | |
echo "activating wp plugin $plugin..." | |
PLUGIN_CHECK="$(wp plugin is-installed $plugin --debug)" | |
if [ $? -eq 0 ]; then | |
PLUGIN_CHECK="$(wp plugin is-active $plugin --debug)" | |
if [ $? -eq 0 ]; then | |
echo "error wp plugin $plugin is already active" | |
else | |
wp plugin activate $plugin --allow-root --debug | |
fi | |
else | |
echo "error wp plugin $plugin is not installed" | |
fi | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment