diff --git a/auto_install/install.sh b/auto_install/install.sh index 2d99876..2888b1d 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -1131,7 +1131,8 @@ 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) + 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 diff --git a/scripts/makeOVPN.sh b/scripts/makeOVPN.sh index 75d2618..e31d4ab 100755 --- a/scripts/makeOVPN.sh +++ b/scripts/makeOVPN.sh @@ -8,8 +8,9 @@ KEY=".key" CA="ca.crt" TA="ta.key" INDEX="/etc/openvpn/easy-rsa/pki/index.txt" -INSTALL_USER=$(cat /etc/pivpn/INSTALL_USER) -INSTALL_HOME=$(cat /etc/passwd | grep "$INSTALL_USER" | cut -d: -f6) +INSTALL_USER=$(