feat: add bds core, locale updates and safety fixes

This commit is contained in:
2026-05-31 14:01:34 +03:00
parent d1686355e8
commit c769140913
34 changed files with 1535 additions and 12 deletions

30
lib/firewall.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
open_firewall_port() {
local port="$1"
local proto="$2"
if [[ "$FIREWALL" != "yes" ]]; then
info "$(t firewall_skip)"
return 0
fi
emit_step "firewall_start" "$port/$proto"
if command -v ufw >/dev/null 2>&1; then
run_cmd ufw allow "$port/$proto" || true
run_cmd ufw --force enable || true
emit_step "firewall_done" "ufw"
return 0
fi
if command -v firewall-cmd >/dev/null 2>&1; then
run_cmd firewall-cmd --permanent --add-port="$port/$proto"
run_cmd firewall-cmd --reload
emit_step "firewall_done" "firewalld"
return 0
fi
warn "$(t firewall_manual_open "$port" "$proto")"
emit_step "firewall_manual" "$port/$proto"
}