From 2a998e54f5f4b8e83b84f3775b675c55bd4a267a Mon Sep 17 00:00:00 2001 From: pvincent Date: Sat, 27 Apr 2024 01:04:40 +0400 Subject: [PATCH] transmission-remote --- lib/functions.sh | 6 +++++- templates/nftables/firewall.table.j2 | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/functions.sh b/lib/functions.sh index c857f70..1057c60 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -114,6 +114,7 @@ function prepare_nftables() { current_target="${TARGET:-not_defined_yet}" desktop=false samba=false + transmission_daemon=false if [[ $current_target == not_defined_yet ]]; then echo -n "generating new firewall table first time... " else @@ -124,7 +125,10 @@ function prepare_nftables() { if exist_command 'smbstatus'; then samba=true fi - echo -n "generating new firewall table according to target=<${current_target}>, desktop=<$desktop>, samba=<$samba> ..." + if exist_command 'transmission-daemon'; then + transmission_daemon=true + fi + echo -n "generating new firewall table according to target=<${current_target}>, desktop=<$desktop>, samba=<$samba>, transmission_daemon=<$transmission_daemon> ..." else echo -n "generating new firewall table according to target=<${current_target}>..." fi diff --git a/templates/nftables/firewall.table.j2 b/templates/nftables/firewall.table.j2 index e3e487b..2526dee 100644 --- a/templates/nftables/firewall.table.j2 +++ b/templates/nftables/firewall.table.j2 @@ -33,6 +33,12 @@ table inet firewall { tcp dport netbios-ssn accept comment "Accept NetBIOS Session Service (smbd)" tcp dport microsoft-ds accept comment "Accept Microsoft Directory Service (smbd)" {%- endif %} + + {%- if env.transmission_daemon == 'true' %} + + # allow TRANSMISSION-REMOTE + tcp dport 9091 accept comment "Accept Transmission Remote Service" + {%- endif %} {%- endif %} {%- endif %} }