Skip to content

Commit

Permalink
Introduce WP_ROOT
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
basilhendroff committed Jan 1, 2021
1 parent 8344373 commit da81eb0
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions wordpress-jail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/)
Expand Down

0 comments on commit da81eb0

Please sign in to comment.