From 3c5c87b031d49335f3ccbe941343c1451f8b7f55 Mon Sep 17 00:00:00 2001 From: patlol Date: Sat, 22 Jul 2017 20:18:46 +0200 Subject: [PATCH] Update openvpn-install.sh --- openvpn-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 603d0a1..3e19335 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -59,10 +59,10 @@ newclient () { # Where to write the custom client.ovpn? if [ -e /home/$1 ]; then # if $1 is a user name homeDir="/home/$1" - elif [ -e /home/${SUDO_USER} ]; then # if not, use SUDO_USER + elif [ ${SUDO_USER} ]; then # if not, use SUDO_USER homeDir="/home/${SUDO_USER}" - else # if not, use /root - homeDir="~" + else # if not SUDO_USER, use /root + homeDir="/root" fi # Generates the custom client.ovpn cp /etc/openvpn/client-template.txt $homeDir/$1.ovpn