diff --git a/spk/owncloud/src/service-setup.sh b/spk/owncloud/src/service-setup.sh index 06ee0f64f1d8..ff8de0b3e037 100755 --- a/spk/owncloud/src/service-setup.sh +++ b/spk/owncloud/src/service-setup.sh @@ -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} @@ -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} @@ -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}