feat: Init check time at first

This commit is contained in:
sang 2024-12-05 11:57:38 +08:00
parent 46f6bd3d09
commit 8da9299ee6

View File

@ -131,6 +131,13 @@ update_lxc_iptags() {
done
}
init() {
current_time=$(date +%s)
last_lxc_status_check_time=${current_time}
last_fw_net_interface_check_time=${current_time}
last_update_time=0
}
check() {
current_time=$(date +%s)
@ -169,6 +176,7 @@ check() {
# main: Set the IP tags for all LXC containers
main() {
init
while true; do
check
sleep "${LOOP_INTERVAL}"