mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-28 15:36:29 +00:00
Fix Docker key.json corruption check (#2125)
* Fix Docker key.json corruption check Since /etc/docker does not get bind mounted anymore (see #2116), key.json from the overlay partition is used directly. * Use -e flag for jq to get useful exit code
This commit is contained in:
parent
bd7a32fd3e
commit
41b452ff48
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
if [ "$SERVICE_RESULT" = "exit-code" ] && [ "$EXIT_STATUS" = "1" ]; then
|
if [ "$SERVICE_RESULT" = "exit-code" ] && [ "$EXIT_STATUS" = "1" ]; then
|
||||||
echo "Docker exited with exit status 1, this might be caused by corrupted key.json."
|
echo "Docker exited with exit status 1, this might be caused by corrupted key.json."
|
||||||
size=$(stat -c %s "/etc/docker/key.json")
|
size=$(stat -c %s "/mnt/overlay/etc/docker/key.json")
|
||||||
echo "key.json: ${size} bytes"
|
echo "key.json: ${size} bytes"
|
||||||
if ! jq < "/etc/docker/key.json" > /dev/null || [ "${size}" -eq 0 ]; then
|
if ! jq -e < "/mnt/overlay/etc/docker/key.json" > /dev/null || [ "${size}" -eq 0 ]; then
|
||||||
echo "key.json appears to be corrupted, it is not parsable. Removing it."
|
echo "key.json appears to be corrupted, it is not parsable. Removing it."
|
||||||
rm -f "/etc/docker/key.json"
|
rm -f "/mnt/overlay/etc/docker/key.json"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user