mirror of
https://github.com/michaelthomson0797/fleet-infra.git
synced 2026-02-04 04:59:54 +00:00
qbittorrent custom port forward script
This commit is contained in:
@@ -47,6 +47,10 @@ spec:
|
||||
mountPath: /config/wg_confs
|
||||
- name: wireguard-config
|
||||
mountPath: /config
|
||||
- name: natpmp-script
|
||||
mountPath: /custom-services.d/natpmp.sh
|
||||
subPath: natpmp.sh
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: qbittorrent-config
|
||||
persistentVolumeClaim:
|
||||
@@ -60,3 +64,6 @@ spec:
|
||||
- name: wireguard-config-secret
|
||||
secret:
|
||||
secretName: wireguard-config-secret
|
||||
- name: natpmp-script
|
||||
configMap:
|
||||
name: natpmp-script
|
||||
|
||||
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
|
||||
@@ -7,6 +7,6 @@ data:
|
||||
PUID: "1000"
|
||||
GUID: "1000"
|
||||
TZ: America/Toronto
|
||||
DOCKER_MODS: ghcr.io/fusetim/external_natpmp_qbittorrent:ecf567b21e5f079762e36c9cee9afaf86fcb22be
|
||||
# DOCKER_MODS: linuxserver/mods:universal-package-install
|
||||
# INSTALL_PACKAGES: libnatpmp
|
||||
DOCKER_MODS: linuxserver/mods:universal-package-install
|
||||
INSTALL_PACKAGES: libnatpmp
|
||||
# DOCKER_MODS: ghcr.io/fusetim/external_natpmp_qbittorrent:ecf567b21e5f079762e36c9cee9afaf86fcb22be
|
||||
|
||||
Reference in New Issue
Block a user