mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-02 19:13:56 +08:00
🔥 Sync 2026-09-28 00:13:15
This commit is contained in:
1 parent
c540ea3fd1
commit
1854a1c960
151 files changed
+25199
-9649
No files matched your search
@@ -423,7 +423,11 @@ maybe_snapshot_wan_log_baseline() {
|
||||
if [ -z "${FWLIVE_WAN_LOG_BASELINE_FILE:-}" ] && [ "$path" = /etc/fwlive/wan-log-baseline ]; then
|
||||
wan_log_lock_dir_safe "$_dir" || return 1
|
||||
fi
|
||||
current=$(wan_zone_log_value "$zone")
|
||||
if [ "$#" -ge 2 ]; then
|
||||
current="$2"
|
||||
else
|
||||
current=$(wan_zone_log_value "$zone")
|
||||
fi
|
||||
printf '%s' "$current" >"$path" 2>/dev/null || return 1
|
||||
return 0
|
||||
}
|
||||
@@ -1036,6 +1040,11 @@ enable_wan_logging() {
|
||||
|
||||
current=$(wan_zone_log_value "$zone")
|
||||
if wan_filter_log_enabled "$current"; then
|
||||
# Already-on with a lost baseline: reconstruct the usual first-enable
|
||||
# snapshot (unset), not the current on-value. Recording "1" would make
|
||||
# uninstall restore logging after disable. Skip-if-exists in
|
||||
# the helper. Failure must not become baseline_snapshot_failed.
|
||||
maybe_snapshot_wan_log_baseline "$zone" "" || true
|
||||
release_wan_log_lock
|
||||
printf '{"ok":true,"changed":false,"wan_zone":%s}' "$zone_json"
|
||||
return 0
|
||||
|
||||
Reference in new issue
Block a user