From 24417e4cab62970fe7829f8bf199e5f7574d5407 Mon Sep 17 00:00:00 2001 From: storfors Date: Tue, 15 Oct 2024 23:45:11 +0100 Subject: [PATCH] Create iptables folder during firewall set up if it doesn't exist. --- alvr/xtask/firewall/alvr_fw_config.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/alvr/xtask/firewall/alvr_fw_config.sh b/alvr/xtask/firewall/alvr_fw_config.sh index 57dd096aff..8c4bf5d327 100755 --- a/alvr/xtask/firewall/alvr_fw_config.sh +++ b/alvr/xtask/firewall/alvr_fw_config.sh @@ -60,6 +60,10 @@ iptables_cfg() { second_port_match_count=$(iptables -S | grep -c '9944') if [ "${1}" == 'add' ]; then if [ "$first_port_match_count" == "0" ] || [ "$second_port_match_count" == "0" ]; then + if [ ! -d '/etc/iptables' ]; then + mkdir '/etc/iptables' + fi + iptables -I OUTPUT -p tcp --sport 9943 -j ACCEPT iptables -I INPUT -p tcp --dport 9943 -j ACCEPT iptables -I OUTPUT -p udp --sport 9943 -j ACCEPT