Avoid CLI restart on shutdown (#2507)

* Avoid CLI restart on shutdown

* Update buildroot-external/rootfs-overlay/usr/sbin/hassos-cli
This commit is contained in:
Stefan Agner 2023-04-24 21:27:21 +02:00 committed by GitHub
parent 27992e2b13
commit bf76a0b473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,19 @@ docker container exec \
-ti hassio_cli \ -ti hassio_cli \
/usr/bin/cli.sh /usr/bin/cli.sh
# Jump to root login shell case $? in
if [ $? -eq 10 ]; then 10)
# Jump to root login shell (login command)
exec /bin/ash -l exec /bin/ash -l
fi ;;
143)
# 143 graceful termination (SIGTERM). Most likely a proper shutdown.
# Just sleep for a while until actual systemd shutdown gets invoked.
echo ""
echo "Home Assistant CLI has been terminated."
sleep 30
;;
*)
echo "HA CLI failed with error code: $?"
;;
esac