Files
Programming-Contests/files/disable_firewall.sh
T
2026-10-15 20:44:05 -03:00

20 lines
597 B
Bash
Executable File

#!/bin/bash
# Turns the contest firewall off (all traffic allowed) for maintenance.
systemctl stop firewall.service
systemctl disable firewall.service
systemctl stop refresh_rules.service
systemctl stop refresh_rules.timer
systemctl disable refresh_rules.service
systemctl disable refresh_rules.timer
nft flush ruleset
nft delete table inet filter 2>/dev/null
echo "Firewall disabled. All traffic is now allowed."
# Reset DNS to its default behaviour (systemd-resolved instead of the filter)
ln -sfn ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
systemctl restart systemd-resolved