From f7bcbb81b48f8d79f8e61055e69350c26dcde38c Mon Sep 17 00:00:00 2001 From: Reditus Date: Wed, 13 May 2026 23:42:17 +0100 Subject: [PATCH] fix: firewall unblock error handling - combine stdout/stderr, handle Bad rule error --- app/routes/api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/routes/api.py b/app/routes/api.py index bf66def..8395565 100644 --- a/app/routes/api.py +++ b/app/routes/api.py @@ -149,8 +149,9 @@ def register_api_routes(app, services, settings): results = [] for cmd in cmds: out, err, rc = ssh.run(cmd, timeout=10) - results.append(err.strip() if err else 'ok') - if rc != 0 and 'No chain' not in err and 'not found' not in err: + combined = (out + err).strip() + results.append(combined if combined else 'ok') + if rc != 0 and 'Bad rule' not in combined and 'No chain' not in combined and 'not found' not in combined: all_ok = False return jsonify({'success': all_ok, 'output': ' / '.join(r for r in results if r)})