Improve setup-qbittorent.zsh
This commit is contained in:
@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user