This commit is contained in:
nu11secur1ty
2024-11-14 16:10:35 +03:00
committed by GitHub
4 changed files with 81 additions and 2 deletions

View File

@@ -1137,13 +1137,13 @@ function newClient() {
# if not, use SUDO_USER
if [ "${SUDO_USER}" == "root" ]; then
# If running sudo as root
homeDir="/root"
homeDir="/etc/openvpn/client/"
else
homeDir="/home/${SUDO_USER}"
fi
else
# if not SUDO_USER, use /root
homeDir="/root"
homeDir="/etc/openvpn/client"
fi
# Determine if we use tls-auth or tls-crypt
@@ -1181,9 +1181,11 @@ function newClient() {
echo "</tls-auth>"
;;
esac
# $homeDir
} >>"$homeDir/$CLIENT.ovpn"
echo ""
# $homeDir
echo "The configuration file has been written to $homeDir/$CLIENT.ovpn."
echo "Download the .ovpn file and import it in your OpenVPN client."