1
1
mirror of https://github.com/angristan/wireguard-install.git synced 2024-06-01 03:00:47 +00:00

Fix $CLIENT_NAME variable

This commit is contained in:
randomshell 2020-07-30 21:16:25 +00:00
parent 3583ffc4c3
commit bea98cdce6

View File

@ -247,8 +247,8 @@ function newClient() {
CLIENT_PRE_SHARED_KEY=$(wg genpsk)
# Home directory of the user, where the client configuration will be written
if [ -e "/home/$CLIENT" ]; then # if $1 is a user name
HOME_DIR="/home/$CLIENT"
if [ -e "/home/${CLIENT_NAME}" ]; then # if $1 is a user name
HOME_DIR="/home/${CLIENT_NAME}"
elif [ "${SUDO_USER}" ]; then # if not, use SUDO_USER
HOME_DIR="/home/${SUDO_USER}"
else # if not SUDO_USER, use /root