diff --git a/auto_install/install.sh b/auto_install/install.sh index bedbb8e..ed30c10 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -1131,8 +1131,9 @@ confOVPN() { # verify server name to strengthen security $SUDO sed -i "s/SRVRNAME/${SERVER_NAME}/" /etc/openvpn/easy-rsa/pki/Default.txt - INSTALL_HOME=$(cat /etc/passwd | grep "$INSTALL_USER" | cut -d: -f6) - if [ ! -d "$INSTALL_HOME/ovpns" ]; then + INSTALL_HOME=$(grep -m1 "^${INSTALL_USER}:" /etc/passwd | cut -d: -f6) + INSTALL_HOME=${INSTALL_HOME%/} # remove possible trailing slash + if [ ! -d "$INSTALL_HOME/ovpns" ]; then $SUDO mkdir "$INSTALL_HOME/ovpns" fi $SUDO chmod 0777 -R "$INSTALL_HOME/ovpns" diff --git a/scripts/makeOVPN.sh b/scripts/makeOVPN.sh index 29605eb..c06f2fa 100755 --- a/scripts/makeOVPN.sh +++ b/scripts/makeOVPN.sh @@ -8,7 +8,7 @@ KEY=".key" CA="ca.crt" TA="ta.key" INDEX="/etc/openvpn/easy-rsa/pki/index.txt" -INSTALL_USER=$(cat /etc/pivpn/INSTALL_USER) +INSTALL_USER=$(