From da81eb04756a4f22587fd5066c40efbcd709324f Mon Sep 17 00:00:00 2001 From: Basil Hendroff <63370329+basilhendroff@users.noreply.github.com> Date: Fri, 1 Jan 2021 15:45:23 +0800 Subject: [PATCH] Introduce WP_ROOT DB_PATH and FILES_PATH are no longer configurable parameters. These were dependent on POOL_PATH and, in use, created confusion for users. WP_ROOT is independent of POOL_PATH. Code checks are also simplified as a result of this change. --- wordpress-jail.sh | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/wordpress-jail.sh b/wordpress-jail.sh index 04c9fda..be5ea22 100755 --- a/wordpress-jail.sh +++ b/wordpress-jail.sh @@ -36,9 +36,7 @@ VNET="on" POOL_PATH="" JAIL_NAME="wordpress" TIME_ZONE="" -HOST_NAME="" -DB_PATH="" -FILES_PATH="" +WP_ROOT="/apps/wordpress" CONFIG_NAME="wordpress-config" # Exposed configuration parameters @@ -87,25 +85,8 @@ if [ -z "${TIME_ZONE}" ]; then exit 1 fi -# If DB_PATH and FILES_PATH weren't set in wordpress-config, set them -if [ -z "${DB_PATH}" ]; then - DB_PATH="${POOL_PATH}"/apps/wordpress/db -fi -if [ -z "${FILES_PATH}" ]; then - FILES_PATH="${POOL_PATH}"/apps/wordpress/files -fi - -# Sanity check DB_PATH and FILES_PATH -- they have to be different and can't be the same as POOL_PATH -if [ "${FILES_PATH}" = "${DB_PATH}" ] -then - print_err "FILES_PATH and DB_PATH must be different!" - exit 1 -fi -if [ "${DB_PATH}" = "${POOL_PATH}" ] || [ "${FILES_PATH}" = "${POOL_PATH}" ] -then - print_err "DB_PATH and FILES_PATH must all be different from POOL_PATH!" - exit 1 -fi +DB_PATH=${POOL_PATH}${WP_ROOT%/}/db +FILES_PATH=${POOL_PATH}${WP_ROOT%/}/files # Extract IP and netmask, sanity check netmask IP=$(echo ${JAIL_IP} | cut -f1 -d/)