commit 24a072141b8fc336934824e015f6d1b4ac0c45a1 Author: supphakitd <67319010028@technictrang.ac.th> Date: Thu Nov 13 17:45:47 2025 +0700 *: initial commit diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..d2c1c4b --- /dev/null +++ b/install.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +install -m 0775 ./wg-port-add /usr/bin/wg-port-add +install -m 0775 ./sc /usr/bin/sc diff --git a/sc b/sc new file mode 100755 index 0000000..4b456aa --- /dev/null +++ b/sc @@ -0,0 +1,3 @@ +#!/bin/bash + +shellcheck "$@" diff --git a/wg-port-add b/wg-port-add new file mode 100755 index 0000000..0dc226f --- /dev/null +++ b/wg-port-add @@ -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 \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"