Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jay Ta'ala
killswitch
Commits
92043675
Commit
92043675
authored
Apr 08, 2019
by
Jay Ta'ala
Browse files
Switched to absolute paths for ufw.
parent
52815edc
Changes
2
Hide whitespace changes
Inline
Side-by-side
vpnkillswitch-off
View file @
92043675
#!/bin/bash
#!/bin/bash
sudo
ufw
--force
reset
sudo
/usr/bin/
ufw
--force
reset
sudo
ufw
enable
sudo
/usr/bin/
ufw
enable
# delete back rules from reset
# delete back rules from reset
sudo rm
/etc/ufw/
*
.rules.
*
sudo
/usr/bin/
rm /etc/ufw/
*
.rules.
*
# reset to defaults and enable
# reset to defaults and enable
sudo
ufw default deny incoming
sudo
/usr/bin/
ufw default deny incoming
sudo
ufw default allow outgoing
sudo
/usr/bin/
ufw default allow outgoing
vpnkillswitch-on
View file @
92043675
#!/bin/bash
#!/bin/bash
# Default policies
# Default policies
sudo
ufw default deny incoming
sudo
/usr/bin/
ufw default deny incoming
sudo
ufw default deny outgoing
sudo
/usr/bin/
ufw default deny outgoing
# Openvpn interface (adjust interface accordingly to your configuration)
# Openvpn interface (adjust interface accordingly to your configuration)
sudo
ufw allow out on tun0
sudo
/usr/bin/
ufw allow out on tun0
# Openvpn (adjust port accordingly to your vpn setup)
# Openvpn (adjust port accordingly to your vpn setup)
sudo
ufw allow out to any port 1194
sudo
/usr/bin/
ufw allow out to any port 1194
# process arguments
# process arguments
while
getopts
"t:"
opt
;
do
while
getopts
"t:"
opt
;
do
case
${
opt
}
in
case
${
opt
}
in
t
)
t
)
echo
"allow outgoing traffic to
$OPTARG
"
echo
"allow outgoing traffic to
$OPTARG
"
sudo
ufw allow out to
$OPTARG
;;
sudo
/usr/bin/
ufw allow out to
$OPTARG
;;
esac
esac
done
done
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment