From af0ff016bbe9c14f709a6d5e621a38996fc19eac Mon Sep 17 00:00:00 2001 From: Sun Knudsen Date: Sat, 5 Sep 2020 08:12:54 -0400 Subject: [PATCH] Moved trap in PF kill switch guide scripts --- .../README.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/how-to-configure-self-hosted-vpn-kill-switch-using-pf-firewall-on-macos/README.md b/how-to-configure-self-hosted-vpn-kill-switch-using-pf-firewall-on-macos/README.md index 9fb040a..ff5e88a 100644 --- a/how-to-configure-self-hosted-vpn-kill-switch-using-pf-firewall-on-macos/README.md +++ b/how-to-configure-self-hosted-vpn-kill-switch-using-pf-firewall-on-macos/README.md @@ -325,6 +325,14 @@ if [ "$(id -u)" != "0" ]; then exit 1 fi +function disable() +{ + /usr/local/sbin/strict.sh + exit 0 +} + +trap disable HUP INT QUIT TERM + red=$'\e[1;31m' end=$'\e[0m' @@ -342,13 +350,6 @@ pfctl -F all -f /etc/pf.conf printf "\n%s\n\n" "${red}Trusted mode enabled (press ctrl+c to disable)${end}" -function disable() -{ - /usr/local/sbin/strict.sh -} - -trap disable EXIT - while : do sleep 60 @@ -368,6 +369,14 @@ if [ "$(id -u)" != "0" ]; then exit 1 fi +function disable() +{ + /usr/local/sbin/strict.sh + exit 0 +} + +trap disable HUP INT QUIT TERM + red=$'\e[1;31m' end=$'\e[0m' @@ -375,13 +384,6 @@ pfctl -d printf "\n%s\n\n" "${red}Firewall disabled (press ctrl+c to enable)${end}" -function disable() -{ - /usr/local/sbin/strict.sh -} - -trap disable EXIT - while : do sleep 60