dynamic pivpn user home dir

This commit is contained in:
orttez 2017-06-16 16:26:55 -04:00
parent 6ce39bfec3
commit 0c44c83146

View file

@ -186,6 +186,7 @@ chooseUser() {
if [[ $? = 0 ]]; then if [[ $? = 0 ]]; then
for desiredUser in ${chooseUserOptions}; do for desiredUser in ${chooseUserOptions}; do
pivpnUser=${desiredUser} pivpnUser=${desiredUser}
pivpnHome=$(eval echo ~${desiredUser})
echo "::: Using User: $pivpnUser" echo "::: Using User: $pivpnUser"
echo "${pivpnUser}" > /tmp/pivpnUSR echo "${pivpnUser}" > /tmp/pivpnUSR
done done
@ -1003,8 +1004,8 @@ confOVPN() {
# verify server name to strengthen security # verify server name to strengthen security
$SUDO sed -i "s/SRVRNAME/${SERVER_NAME}/" /etc/openvpn/easy-rsa/pki/Default.txt $SUDO sed -i "s/SRVRNAME/${SERVER_NAME}/" /etc/openvpn/easy-rsa/pki/Default.txt
$SUDO mkdir "/home/$pivpnUser/ovpns" $SUDO mkdir "$pivpnHome/ovpns"
$SUDO chmod 0777 -R "/home/$pivpnUser/ovpns" $SUDO chmod 0777 -R "$pivpnHome/ovpns"
} }
installPiVPN() { installPiVPN() {