Moved trap in PF kill switch guide scripts
This commit is contained in:
parent
e9474a3546
commit
af0ff016bb
1 changed files with 16 additions and 14 deletions
|
@ -325,6 +325,14 @@ if [ "$(id -u)" != "0" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function disable()
|
||||||
|
{
|
||||||
|
/usr/local/sbin/strict.sh
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
trap disable HUP INT QUIT TERM
|
||||||
|
|
||||||
red=$'\e[1;31m'
|
red=$'\e[1;31m'
|
||||||
end=$'\e[0m'
|
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}"
|
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 :
|
while :
|
||||||
do
|
do
|
||||||
sleep 60
|
sleep 60
|
||||||
|
@ -368,6 +369,14 @@ if [ "$(id -u)" != "0" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function disable()
|
||||||
|
{
|
||||||
|
/usr/local/sbin/strict.sh
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
trap disable HUP INT QUIT TERM
|
||||||
|
|
||||||
red=$'\e[1;31m'
|
red=$'\e[1;31m'
|
||||||
end=$'\e[0m'
|
end=$'\e[0m'
|
||||||
|
|
||||||
|
@ -375,13 +384,6 @@ pfctl -d
|
||||||
|
|
||||||
printf "\n%s\n\n" "${red}Firewall disabled (press ctrl+c to enable)${end}"
|
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 :
|
while :
|
||||||
do
|
do
|
||||||
sleep 60
|
sleep 60
|
||||||
|
|
Loading…
Add table
Reference in a new issue