From 21e3078de5b7b67ef6f9c6f82ce8d68c00018f11 Mon Sep 17 00:00:00 2001 From: orttez Date: Fri, 16 Jun 2017 16:35:40 -0400 Subject: [PATCH] pivpn home dir --- scripts/makeOVPN.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/makeOVPN.sh b/scripts/makeOVPN.sh index db15efe..2c232ba 100644 --- a/scripts/makeOVPN.sh +++ b/scripts/makeOVPN.sh @@ -9,6 +9,7 @@ CA="ca.crt" TA="ta.key" INDEX="/etc/openvpn/easy-rsa/pki/index.txt" INSTALL_USER=$(cat /etc/pivpn/INSTALL_USER) +INSTALL_HOME=$(eval echo ~${INSTALL_USER}) # Functions def @@ -170,12 +171,12 @@ echo "tls-auth Private Key found: $TA" } > "${NAME}${FILEEXT}" # Copy the .ovpn profile to the home directory for convenient remote access -cp "/etc/openvpn/easy-rsa/pki/$NAME$FILEEXT" "/home/$INSTALL_USER/ovpns/$NAME$FILEEXT" -chown "$INSTALL_USER" "/home/$INSTALL_USER/ovpns/$NAME$FILEEXT" +cp "/etc/openvpn/easy-rsa/pki/$NAME$FILEEXT" "$INSTALL_HOME/ovpns/$NAME$FILEEXT" +chown "$INSTALL_USER" "$INSTALL_HOME/ovpns/$NAME$FILEEXT" printf "\n\n" printf "========================================================\n" printf "\e[1mDone! %s successfully created!\e[0m \n" "$NAME$FILEEXT" printf "%s was copied to:\n" "$NAME$FILEEXT" -printf " /home/%s/ovpns\n" "$INSTALL_USER" +printf " %s/ovpns\n" "$INSTALL_HOME" printf "for easy transfer.\n" printf "========================================================\n\n"