In case the data partition is missing avoid using the Docker command. The Docker command triggers a socket activation, which in turn makes systemd wait for the data partition. This blocks entry into the shell forever. Just enter the shell in case data partition is not mounted.
33 lines
829 B
Bash
Executable File
33 lines
829 B
Bash
Executable File
#!/bin/sh
|
|
# ==============================================================================
|
|
# Run logging cli
|
|
# ==============================================================================
|
|
|
|
# Setup terminal size on serial console
|
|
if [ "${TERM}" = "vt220" ] || [ "${TERM}" = "vt102" ] || \
|
|
[ "${TERM}" = "vt100" ]; then
|
|
resize
|
|
fi
|
|
|
|
# Run CLI container
|
|
if [ ! "$(findmnt /mnt/data)" ]; then
|
|
echo "[WARN] Data partition not mounted! Jump into emergency console..."
|
|
exec /bin/ash -l
|
|
fi
|
|
|
|
if [ "$(docker ps -q -f name=hassio_cli)" ]; then
|
|
docker container exec \
|
|
-ti hassio_cli \
|
|
/usr/bin/cli.sh \
|
|
|
|
# Jump to root login shell
|
|
if [ $? -eq 10 ]; then
|
|
/bin/ash -l
|
|
fi
|
|
else
|
|
echo "[WARN] Home Assistant CLI is not running! Jump into emergency console..."
|
|
exec /bin/ash -l
|
|
fi
|
|
|
|
exit
|