Add HEALTHCHECK

This commit is contained in:
Albrecht Lohofener
2024-11-06 14:13:37 +01:00
parent 263d433619
commit 3d7251930b
2 changed files with 12 additions and 0 deletions
+2
View File
@@ -149,4 +149,6 @@ EXPOSE 8022
RUN echo "$VERSION_ARG" > /run/version \
&& echo "CONTAINER_CREATE_DATETIME=\"`date`\"" >> /var/vm/openwrt_metadata.conf
HEALTHCHECK --start-period=10m CMD /run/healthcheck.sh
CMD ["/run/init_container.sh"]
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
# Check if the output contains "OpenWrt"
if /run/qemu_qmp.sh -V | grep -q "OpenWrt"; then
# If "OpenWrt" is found, exit with status 0 (healthy)
exit 0
else
# If "OpenWrt" is not found, exit with status 1 (unhealthy)
exit 1
fi