From cf2fd5efe5a12713db3d905bd25b51af8eba0fbc Mon Sep 17 00:00:00 2001 From: bedefaced Date: Mon, 17 Apr 2017 16:04:54 +0300 Subject: [PATCH] sudo username fix --- openvpn/install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openvpn/install.sh b/openvpn/install.sh index adcb15a..97ba47c 100755 --- a/openvpn/install.sh +++ b/openvpn/install.sh @@ -119,7 +119,8 @@ do echo echo "Created directory $STARTDIR/$LOGIN with necessary files." - chown -R ${USER:=$(/usr/bin/id -run)}:$USER $STARTDIR/$LOGIN/ + USERNAME=${SUDO_USER:-$USER} + chown -R $USERNAME:$USERNAME $STARTDIR/$LOGIN/ fi