From 65b557d00333f6ea12c8d26ea0cb0ae8e6c0af38 Mon Sep 17 00:00:00 2001 From: Ryan Caezar Itang Date: Tue, 16 Aug 2022 11:57:14 +0800 Subject: [PATCH] Add batch files to add and remove firewall rules --- src_assets/windows/misc/firewall/add-firewall-rule.bat | 8 ++++++++ src_assets/windows/misc/firewall/delete-firewall-rule.bat | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 src_assets/windows/misc/firewall/add-firewall-rule.bat create mode 100644 src_assets/windows/misc/firewall/delete-firewall-rule.bat diff --git a/src_assets/windows/misc/firewall/add-firewall-rule.bat b/src_assets/windows/misc/firewall/add-firewall-rule.bat new file mode 100644 index 00000000..8c3e7b9e --- /dev/null +++ b/src_assets/windows/misc/firewall/add-firewall-rule.bat @@ -0,0 +1,8 @@ +@echo off + +set RULE_NAME=Sunshine +set PROGRAM_BIN="%~dp0sunshine.exe" + +rem Add the rule +netsh advfirewall firewall add rule name=%RULE_NAME% dir=in action=allow protocol=tcp program=%PROGRAM_BIN% enable=yes +netsh advfirewall firewall add rule name=%RULE_NAME% dir=in action=allow protocol=udp program=%PROGRAM_BIN% enable=yes diff --git a/src_assets/windows/misc/firewall/delete-firewall-rule.bat b/src_assets/windows/misc/firewall/delete-firewall-rule.bat new file mode 100644 index 00000000..3ab0d4e9 --- /dev/null +++ b/src_assets/windows/misc/firewall/delete-firewall-rule.bat @@ -0,0 +1,6 @@ +@echo off + +set RULE_NAME=Sunshine + +rem Delete the rule +netsh advfirewall firewall delete rule name=%RULE_NAME%