blob: f10ce0851724277ab156ca40c0d3f17317b13b23 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/bin/bash
# Allow inbound TCP to dserver (default port 2222) when firewalld is used.
# Run once on the server as root, or fold into your config management.
set -euo pipefail
PORT="${DTAIL_FIREWALL_PORT:-2222}"
if ! command -v firewall-cmd >/dev/null 2>&1; then
echo "firewall-cmd not found; skip or configure your firewall manually." >&2
exit 0
fi
if ! firewall-cmd --state >/dev/null 2>&1; then
echo "firewalld not running; nothing to do." >&2
exit 0
fi
firewall-cmd --permanent "--add-port=${PORT}/tcp"
firewall-cmd --reload
echo "Opened ${PORT}/tcp. Current ports: $(firewall-cmd --list-ports)"
|