summaryrefslogtreecommitdiff
path: root/start_container.sh
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-02-07 19:58:55 +0800
committerYour Name <you@example.com>2026-02-07 19:58:55 +0800
commitd1cebc658174a16014c2a3847bdf55bb3553b7fb (patch)
tree843abd31aabf15bdf9c78314c69922a5df586531 /start_container.sh
parent7bd52ea1ae10870cc2ff8aa5c237679c30ffda72 (diff)
more robust for ssh floods
Diffstat (limited to 'start_container.sh')
-rwxr-xr-xstart_container.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/start_container.sh b/start_container.sh
index 25fcb10..2299390 100755
--- a/start_container.sh
+++ b/start_container.sh
@@ -33,6 +33,7 @@ podman run -d \
33 --network ${NETWORK} \ 33 --network ${NETWORK} \
34 --ip ${PRIVATE_IP} \ 34 --ip ${PRIVATE_IP} \
35 --cap-add=NET_ADMIN \ 35 --cap-add=NET_ADMIN \
36 --pids-limit=100 \
36 --env-file "$(dirname "$0")/config.env" \ 37 --env-file "$(dirname "$0")/config.env" \
37 -v ${CONTAINER_NAME}_data:/data \ 38 -v ${CONTAINER_NAME}_data:/data \
38 -v /git:/git \ 39 -v /git:/git \
@@ -40,6 +41,7 @@ podman run -d \
40 41
41# Setup public IP 42# Setup public IP
42sleep 2 43sleep 2
44# Get the container's network interface name (e.g. eth0)
43IFACE=$(podman exec ${CONTAINER_NAME} sh -c "ip -o link | grep -v lo | head -1 | cut -d: -f2 | tr -d ' ' | cut -d@ -f1") 45IFACE=$(podman exec ${CONTAINER_NAME} sh -c "ip -o link | grep -v lo | head -1 | cut -d: -f2 | tr -d ' ' | cut -d@ -f1")
44podman exec ${CONTAINER_NAME} ip addr add ${PUBLIC_IP}/32 dev ${IFACE} 46podman exec ${CONTAINER_NAME} ip addr add ${PUBLIC_IP}/32 dev ${IFACE}
45ip route add ${PUBLIC_IP}/32 via ${PRIVATE_IP} 47ip route add ${PUBLIC_IP}/32 via ${PRIVATE_IP}