Skip to content

Commit

Permalink
Fix for multiple PHP profiles in DSM 6
Browse files Browse the repository at this point in the history
  • Loading branch information
mreid-tt committed Nov 8, 2023
1 parent 3becafa commit 7fd7651
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions spk/owncloud/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,12 @@ service_postinst ()
fi
# Restart Apache if configs have changed
if [ "$CFG_UPDATE" = "yes" ]; then
echo "Restart Apache to load new configs"
${SYNOSVC} --restart pkgctl-Apache2.4
if ${JQ} -e 'to_entries | map(select(.key | startswith("com-synocommunity-packages-"))) | length > 1' "${WS_CFG_PATH}/${PHP_CFG_FILE}" >/dev/null; then
echo "Multiple PHP profiles detected, will require restart of DSM to load new configs"
else
echo "Restart Apache to load new configs"
${SYNOSVC} --restart pkgctl-Apache2.4
fi
fi
# Clean-up temporary files
${RM} ${TEMPDIR}
Expand Down Expand Up @@ -362,8 +366,12 @@ service_postuninst ()
fi
# Restart Apache if configs have changed
if [ "$CFG_UPDATE" = "yes" ]; then
echo "Restart Apache to load new configs"
${SYNOSVC} --restart pkgctl-Apache2.4
if ${JQ} -e 'to_entries | map(select(.key | startswith("com-synocommunity-packages-"))) | length > 1' "${WS_CFG_PATH}/${PHP_CFG_FILE}" >/dev/null; then
echo "Multiple PHP profiles detected, will require restart of DSM to load new configs"
else
echo "Restart Apache to load new configs"
${SYNOSVC} --restart pkgctl-Apache2.4
fi
fi
# Clean-up temporary files
${RM} ${TEMPDIR}
Expand Down Expand Up @@ -392,8 +400,12 @@ service_postupgrade()
fi
# Restart Apache if configs have changed
if [ "$CFG_UPDATE" = "yes" ]; then
echo "Restart Apache to load new configs"
${SYNOSVC} --restart pkgctl-Apache2.4
if ${JQ} -e 'to_entries | map(select(.key | startswith("com-synocommunity-packages-"))) | length > 1' "${WS_CFG_PATH}/${PHP_CFG_FILE}" >/dev/null; then
echo "Multiple PHP profiles detected, will require restart of DSM to load new configs"
else
echo "Restart Apache to load new configs"
${SYNOSVC} --restart pkgctl-Apache2.4
fi
fi
# Clean-up temporary files
${RM} ${TEMPDIR}
Expand Down

0 comments on commit 7fd7651

Please sign in to comment.