Skip to content

Commit e2c752f

Browse files
authored
fix: Allow restart with HA fix applied (#289)
1 parent cb1d19a commit e2c752f

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

files/docker-entrypoint.d/30-apply-home-assistant-fix.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,24 @@ then
99
exit 0
1010
fi
1111

12+
# Skip further processing if the current Plugin.php file already has the Home Assistant fix
13+
CHECKSUM="7a7c9adc36dfc6cf780039d1ff7800df3e5f138a /var/www/baikal/vendor/sabre/dav/lib/CalDAV/Plugin.php"
14+
if echo $CHECKSUM | sha1sum --check --status - ;
15+
then
16+
echo "$ME: info: Home Assistant fix already applied"
17+
exit 0
18+
fi
19+
1220
# Abort if the Plugin.php file differs from the packaged version.
13-
# This means either the user customized the Plugin.php file already, or the
14-
# packaged version changed and the fix needs to be updated.
21+
# This means the user customized the Plugin.php file already and applying the
22+
# Home Assistant fix would remove any modifications the user did. We inform the
23+
# user about this, so that they can make the necessary adjustments to their
24+
# custom Plugin.php file.
1525
CHECKSUM="22e5ac3311fa112e702363920ce86d90256aacc6 /var/www/baikal/vendor/sabre/dav/lib/CalDAV/Plugin.php"
1626
if ! echo $CHECKSUM | sha1sum --check --status - ;
1727
then
18-
echo "$ME: info: Plugin.php differs from the packaged version"
19-
exit 0
28+
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."
29+
exit 1
2030
fi
2131

2232

0 commit comments

Comments
 (0)