*: initial commit
This commit is contained in:
4
install.sh
Executable file
4
install.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
install -m 0775 ./wg-port-add /usr/bin/wg-port-add
|
||||||
|
install -m 0775 ./sc /usr/bin/sc
|
||||||
19
wg-port-add
Executable file
19
wg-port-add
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
n="$(basename $0)"
|
||||||
|
|
||||||
|
quit() {
|
||||||
|
printf "%s: %s\n" "$n" "$1"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
printf "UFW Allow Port for WireGuard interface.\n"
|
||||||
|
printf "usage: %s <tcp,udp> <XX>\n" "$n"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ -z $1 && -z $2 ]] && usage
|
||||||
|
[[ -z $1 ]] && quit "Required Protocol (tcp,udp)"
|
||||||
|
[[ -z $2 ]] && quit "Required Port Number"
|
||||||
|
|
||||||
|
sudo ufw allow in on wg0 proto "$1" to any port "$2"
|
||||||
Reference in New Issue
Block a user