From 6f77993798271ee963d2e5f01f7465289f66a49d Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Fri, 20 Mar 2026 06:51:44 +0700 Subject: [PATCH] update --- check_router_reboot.jl | 4 ++-- check_router_reboot_log.txt | 24 ++++++++---------------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/check_router_reboot.jl b/check_router_reboot.jl index 3889e56..4c65d9f 100644 --- a/check_router_reboot.jl +++ b/check_router_reboot.jl @@ -20,7 +20,7 @@ const ATTEMPTS_PER_CHECK = 3 # number of ping attempts per check const BACKOFF_BETWEEN_ATTEMPTS = 60 # seconds between attempts const FAILS_TO_REBOOT = 3 # consecutive failed checks required to trigger reboot const COOLDOWN_AFTER_REBOOT_SECS = 600 # do not reboot again within this many seconds -const DRY_RUN = false # set false to actually reboot +const DRY_RUN = true # set false to actually reboot const CHECK_INTERVAL_SECS = 60 # run a check every CHECK_INTERVAL_SECS seconds const thisFolderPath = @__DIR__ @@ -237,7 +237,7 @@ function perform_check!(st::State) end success = false - last_res7ult = nothing + last_result = nothing for i in 1:ATTEMPTS_PER_CHECK ok, result = check_router_once(ROUTER_IP) last_result = result diff --git a/check_router_reboot_log.txt b/check_router_reboot_log.txt index 1da62a8..9b3a667 100644 --- a/check_router_reboot_log.txt +++ b/check_router_reboot_log.txt @@ -1,19 +1,3 @@ -[2026-03-11T15:51:04.131] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing) -[2026-03-11T15:52:04.197] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing) -[2026-03-11T15:53:04.266] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing) -[2026-03-11T16:10:04.474] Starting check loop. Checking router 192.168.88.1 every 60 seconds. -[2026-03-11T16:10:05.449] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing) -[2026-03-11T16:12:13.704] Starting check loop. Checking router 192.168.88.1 every 60 seconds. -[2026-03-11T16:12:14.671] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing) -[2026-03-11T16:13:14.215] Starting check loop. Checking router 192.168.88.1 every 60 seconds. -[2026-03-11T16:13:15.192] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing) -[2026-03-11T16:14:19.623] Starting check loop. Checking router 192.168.88.1 every 60 seconds. -[2026-03-11T16:14:20.610] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing) -[2026-03-11T16:14:54.601] Starting check loop. Checking router 192.168.88.1 every 60 seconds. -[2026-03-11T16:14:55.573] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing) -[2026-03-11T16:15:48.563] Starting check loop. Checking router 192.168.88.1 every 60 seconds. -[2026-03-11T16:15:49.540] Error during check: SystemError("opening file \"/home/ton/docker-programs/check_and_reboot/check_and_reboot_state.json\"", 13, nothing) -[2026-03-11T16:27:47.181] Starting check loop. Checking router 192.168.88.1 every 60 seconds. [2026-03-11T16:30:28.572] Starting check loop. Checking router 192.168.88.1 every 60 seconds. [2026-03-11T16:43:50.213] Starting check loop. Checking router 192.168.88.1 every 60 seconds. [2026-03-11T17:37:15.954] Starting check loop. Checking router 192.168.88.1 every 60 seconds. @@ -107,3 +91,11 @@ [2026-03-19T18:35:25.731] In cooldown after recent reboot; skipping check. 452/600 seconds [2026-03-19T18:36:25.793] In cooldown after recent reboot; skipping check. 512/600 seconds [2026-03-19T18:37:25.855] In cooldown after recent reboot; skipping check. 572/600 seconds +[2026-03-19T20:46:13.597] Starting check loop. Checking router 192.168.88.1 every 60 seconds. +[2026-03-19T21:11:24.478] Error during check: UndefVarError(:last_result, 0x000000000000975f, Main) +[2026-03-19T21:15:32.383] Error during check: UndefVarError(:last_result, 0x000000000000975f, Main) +[2026-03-19T21:19:41.791] Error during check: UndefVarError(:last_result, 0x000000000000975f, Main) +[2026-03-20T06:30:24.932] Starting check loop. Checking router 192.168.88.1 every 60 seconds. +[2026-03-20T06:33:34.781] Error during check: UndefVarError(:last_result, 0x000000000000975f, Main) +[2026-03-20T06:34:34.835] 192.168.88.1 is reachable; resetting consecutive failure counter. +[2026-03-20T06:50:10.447] Starting check loop. Checking router 192.168.88.1 every 60 seconds.