fix(api): improve error handling and quoting in agent scripts
Build and Push EvoFirewall Docker Image / build-and-push (push) Successful in 1m43s
Build and Push EvoFirewall Docker Image / create-release (push) Skipped

- Updated `evofw-firewall.sh` to correctly handle exit codes from the `curl_policy` function, ensuring proper script termination based on policy retrieval status.
- Enhanced `install.sh` to always use single quotes for configuration values, improving safety for names with spaces, and refined the logic for updating the `KERNEL_BACKEND` in the configuration file.
- Updated documentation to reflect the changes in quoting and exit behavior during installation and synchronization processes.
This commit is contained in:
Denozordec
2026-07-21 23:18:03 +07:00
parent 38f7a8296e
commit 68d9246158
3 changed files with 28 additions and 12 deletions
+7 -3
View File
@@ -43,9 +43,13 @@ curl_policy() {
return 0
}
if ! curl_policy "$POLICY_FILE"; then
rc=$?
[[ "$rc" == "2" ]] && exit 0
# Do not use `if ! cmd; rc=$?` — after `!`, $? is 0, not the real status.
policy_rc=0
curl_policy "$POLICY_FILE" || policy_rc=$?
if [[ "$policy_rc" -eq 2 ]]; then
exit 0
fi
if [[ "$policy_rc" -ne 0 ]]; then
exit 1
fi