mirror of
https://github.com/AlbrechtL/openwrt-docker.git
synced 2026-10-19 16:01:40 +00:00
Add HEALTHCHECK
This commit is contained in:
@@ -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"]
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user