Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed to use INCOMING_PORT_ENV (from README.md) #114

Open
wants to merge 1 commit into
base: focal
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions qbittorrent/iptables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ else
fi

# accept input to qbittorrent daemon port - used for lan access
if [ -z "${INCOMING_PORT}" ]; then
if [ -z "${INCOMING_PORT_ENV}" ]; then
iptables -A INPUT -i eth0 -s "${LAN_NETWORK}" -p tcp --dport 8999 -j ACCEPT
else
iptables -A INPUT -i eth0 -s "${LAN_NETWORK}" -p tcp --dport ${INCOMING_PORT} -j ACCEPT
iptables -A INPUT -i eth0 -s "${LAN_NETWORK}" -p tcp --dport ${INCOMING_PORT_ENV} -j ACCEPT
fi


Expand Down Expand Up @@ -164,11 +164,11 @@ else
fi

# accept output to qBittorrent daemon port - used for lan access
if [ -z "${INCOMING_PORT}" ]; then
if [ -z "${INCOMING_PORT_ENV}" ]; then
iptables -A OUTPUT -o eth0 -d "${LAN_NETWORK}" -p tcp --sport 8999 -j ACCEPT
else
echo "[info] Incoming connections port defined as ${INCOMING_PORT}" | ts '%Y-%m-%d %H:%M:%.S'
iptables -A OUTPUT -o eth0 -d "${LAN_NETWORK}" -p tcp --sport ${INCOMING_PORT} -j ACCEPT
echo "[info] Incoming connections port defined as ${INCOMING_PORT_ENV}" | ts '%Y-%m-%d %H:%M:%.S'
iptables -A OUTPUT -o eth0 -d "${LAN_NETWORK}" -p tcp --sport ${INCOMING_PORT_ENV} -j ACCEPT
fi

# accept output for icmp (ping)
Expand Down