From 484619faa7ec170ba0e760a100eacd750d0ce7da Mon Sep 17 00:00:00 2001 From: Cyrill Kulka Date: Tue, 29 Jul 2025 23:06:04 +0200 Subject: [PATCH] fix: Allow restart with HA fix applied --- .../30-apply-home-assistant-fix.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/files/docker-entrypoint.d/30-apply-home-assistant-fix.sh b/files/docker-entrypoint.d/30-apply-home-assistant-fix.sh index 4fa0fb3..2a2f50d 100755 --- a/files/docker-entrypoint.d/30-apply-home-assistant-fix.sh +++ b/files/docker-entrypoint.d/30-apply-home-assistant-fix.sh @@ -9,14 +9,24 @@ then exit 0 fi +# Skip further processing if the current Plugin.php file already has the Home Assistant fix +CHECKSUM="7a7c9adc36dfc6cf780039d1ff7800df3e5f138a /var/www/baikal/vendor/sabre/dav/lib/CalDAV/Plugin.php" +if echo $CHECKSUM | sha1sum --check --status - ; +then + echo "$ME: info: Home Assistant fix already applied" + exit 0 +fi + # Abort if the Plugin.php file differs from the packaged version. -# This means either the user customized the Plugin.php file already, or the -# packaged version changed and the fix needs to be updated. +# This means the user customized the Plugin.php file already and applying the +# Home Assistant fix would remove any modifications the user did. We inform the +# user about this, so that they can make the necessary adjustments to their +# custom Plugin.php file. CHECKSUM="22e5ac3311fa112e702363920ce86d90256aacc6 /var/www/baikal/vendor/sabre/dav/lib/CalDAV/Plugin.php" if ! echo $CHECKSUM | sha1sum --check --status - ; then - echo "$ME: info: Plugin.php differs from the packaged version" - exit 0 + echo "$ME: info: Plugin.php differs from the packaged version. It looks like you customized it already, so we won't overwrite it and remove your modifications. Please either revert your own changes, or apply the Home Assistant fix manually to your custom Plugin.php file." + exit 1 fi