Skip to content

Commit

Permalink
Add check for PHP template modification
Browse files Browse the repository at this point in the history
  • Loading branch information
mreid-tt committed Nov 8, 2023
1 parent ca58089 commit 84065e0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spk/selfoss/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,20 @@ service_postuninst ()
fi
}

validate_preinst ()
{
# Check for modification to PHP template defaults on DSM 6
if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 7 ]; then
WS_TMPL_PATH="/var/packages/WebStation/target/misc"
WS_TMPL_FILE="php74_fpm.mustache"
# Check for PHP template defaults
if ! grep -q -E '^user = http$' "${WS_TMPL_PATH}/${WS_TMPL_FILE}" || ! grep -q -E '^listen\.owner = http$' "${WS_TMPL_PATH}/${WS_TMPL_FILE}"; then
echo "PHP template defaults have been modified. Installation is not supported."
exit 1
fi
fi
}

service_save ()
{
# Backup configuration and data
Expand Down

0 comments on commit 84065e0

Please sign in to comment.