Improve setup-qbittorent.zsh

This commit is contained in:
2026-02-26 13:05:01 -08:00
parent 304be63652
commit 618cb4869b

View File

@ -23,8 +23,15 @@ printf 'Using interface: %s\n' "${iface}"
# <-A|-D> <ex_ip> <in_ip>
function do_rules {
emulate -L zsh
function handle_error {
setopt noxtrace
echo Failed to add iptables rules
rm -f "${save_file}"
exit 1
}
[[ "${1}" = -A ]] && trap handle_error INT ZERR
PS4='Run: '
setopt errexit xtrace
setopt xtrace
doas iptables -t filter "${1}" FORWARD -i "${iface}" -o wg0-mullvad -j ACCEPT
doas iptables -t nat "${1}" PREROUTING -d "${2}"/32 -p tcp -m tcp --dport 62000 \