mirror of
https://github.com/michaelthomson0797/fleet-infra.git
synced 2026-02-04 13:09:53 +00:00
26 lines
682 B
YAML
26 lines
682 B
YAML
apiVersion: v1
|
|
data:
|
|
natpmp.sh: |
|
|
#!/bin/sh
|
|
|
|
while true; do
|
|
date
|
|
|
|
# Run natpmpc for UDP and TCP, redirect output to a temporary file
|
|
natpmpc -a 1 0 udp 60 -g 10.2.0.1 && natpmpc -a 1 0 tcp 60 -g 10.2.0.1 > /tmp/natpmpc_output || {
|
|
echo -e "ERROR with natpmpc command \a"
|
|
break
|
|
}
|
|
|
|
# Extract the port numbers from the output and save them in variables
|
|
port=$(grep 'TCP' /tmp/natpmpc_output | grep -o 'Mapped public port [0-9]*' | awk '{print $4}')
|
|
|
|
echo "Opened port: $port"
|
|
sleep 45
|
|
done
|
|
kind: ConfigMap
|
|
metadata:
|
|
creationTimestamp: null
|
|
name: natpmp-script
|
|
namespace: media
|