avoid unnecessary nested content
This commit is contained in:
8
torrents/config/01-natpmp-install
Executable file
8
torrents/config/01-natpmp-install
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/command/with-contenv bash
|
||||
|
||||
echo "Installing Git..."
|
||||
apk add -u git
|
||||
|
||||
echo "Installing py-natpmp"
|
||||
rm -r /py-natpmp || echo "py-natpmp clean"
|
||||
git clone https://github.com/yimingliu/py-natpmp.git /py-natpmp
|
||||
23
torrents/config/98-gateway-setup
Executable file
23
torrents/config/98-gateway-setup
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/command/with-contenv bash
|
||||
|
||||
echo "Obtaining Wireguard Server IP..."
|
||||
wgserver=$(grep Endpoint "${CONFIG_DIR}/wireguard/wg0.conf" | awk '{print $3}')
|
||||
echo "IP: ${wgserver%:*}"
|
||||
|
||||
echo "Obtaining default gateway..."
|
||||
gateway=$(ip -o -4 route show to default | awk '{print $3}')
|
||||
echo "Gateway: ${gateway}"
|
||||
|
||||
echo "Adding route to Wireguard Server via Default Gateway"
|
||||
ip route add ${wgserver%:*}/32 via ${gateway} dev eth0
|
||||
|
||||
echo "Allow DNS resolution locally"
|
||||
iptables -A INPUT -i eth0 -p udp -m udp --sport 53 -j ACCEPT
|
||||
iptables -A OUTPUT -o eth0 -p udp -m udp --dport 53 -j ACCEPT
|
||||
|
||||
echo "Allow docker networks to connect"
|
||||
docker_cirds=$(ip -o -4 route show proto kernel | awk '{print $1}')
|
||||
for cidr in $docker_cirds; do
|
||||
iptables -A INPUT -s "${cidr}" -d "${cidr}" -j ACCEPT
|
||||
iptables -A OUTPUT -s "${cidr}" -d "${cidr}" -j ACCEPT
|
||||
done
|
||||
4
torrents/config/99-cron-start
Executable file
4
torrents/config/99-cron-start
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/command/with-contenv bash
|
||||
|
||||
(crontab -l ; echo "* * * * * run-parts /etc/periodic/1min") | sort - | uniq - | crontab -
|
||||
crond
|
||||
3
torrents/config/setPortForward
Executable file
3
torrents/config/setPortForward
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/command/with-contenv bash
|
||||
listen_port=$(python3 /py-natpmp/natpmp/natpmp_client.py -g 10.2.0.1 0 0 | sed -E 's/.*?public port ([0-9]+).*?/\1/')
|
||||
curl -F "json={\"listen_port\": ${listen_port}}" http://localhost:8080/api/v2/app/setPreferences
|
||||
4
torrents/config/updateMaMIP
Executable file
4
torrents/config/updateMaMIP
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
[ -f /config/mam.cookies ] || exit 1
|
||||
curl -c /config/mam.cookies -b /config/mam.cookies https://t.myanonamouse.net/json/dynamicSeedbox.php
|
||||
Reference in New Issue
Block a user