diff --git a/rootfs/etc/cont-init.d/20-install-plugins b/rootfs/etc/cont-init.d/20-install-plugins index 16082e2..067e68c 100755 --- a/rootfs/etc/cont-init.d/20-install-plugins +++ b/rootfs/etc/cont-init.d/20-install-plugins @@ -2,6 +2,7 @@ set -e PLUGIN_LIST="${WORDPRESS_PLUGIN_LIST:-}" +WP_CONTENT_PATH="/var/www/${WEB_ROOT}/wp-content" echo "> Automated WordPress Plugin Installer" @@ -20,6 +21,13 @@ for PLUGIN_NAME in ${PLUGIN_LIST}; do WP_PLUGIN_INSTALL_ARGS="${WP_PLUGIN_INSTALL_ARGS} --version=${PLUGIN[1]}" fi + PLUGIN_PATH="${WP_CONTENT_PATH}/plugins/${PLUGIN[0]}" + + if [ -d "${PLUGIN_PATH}" ] || [ -f "${PLUGIN_PATH}.php" ]; then + echo "> Plugin '${PLUGIN[0]}' already installed and will be skipped." + continue + fi + echo "> Installing plugin '${PLUGIN[0]}' version '${PLUGIN[1]}'" wp plugin install ${WP_PLUGIN_INSTALL_ARGS} done \ No newline at end of file