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 50399fd commit 4523b65
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions spk/selfoss/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,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-")) and .key != "com-synocommunity-packages-selfoss")) | length > 0' "${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 @@ -137,8 +141,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-")) and .key != "com-synocommunity-packages-selfoss")) | length > 0' "${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 4523b65

Please sign in to comment.