mirror of
https://github.com/michaelthomson0797/fleet-infra.git
synced 2026-02-04 21:09:58 +00:00
qbittorrent custom port forward script
This commit is contained in:
25
media/qbittorrent/natpmp-script.yaml
Normal file
25
media/qbittorrent/natpmp-script.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
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
|
||||
Reference in New Issue
Block a user