*: initial commit

This commit is contained in:
2025-11-13 17:45:47 +07:00
commit 24a072141b
3 changed files with 26 additions and 0 deletions

4
install.sh Executable file
View 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

3
sc Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
shellcheck "$@"

19
wg-port-add Executable file
View 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"