18 lines
236 B
Bash
Executable File
18 lines
236 B
Bash
Executable File
#!/bin/sh
|
|
|
|
stop() {
|
|
ufw disable
|
|
|
|
# Clear the trap
|
|
trap - SIGINT SIGTERM
|
|
kill -- -$(pgrep iptables.sh)
|
|
}
|
|
|
|
ufw enable
|
|
|
|
# Run stop function when SIGINT or SIGTERM signals are caught
|
|
trap "stop $1" SIGINT SIGTERM
|
|
sleep infinity
|
|
|
|
|