mirror of
https://github.com/angristan/openvpn-install.git
synced 2025-01-08 07:40:05 +01:00
Update openvpn-install.sh
This commit is contained in:
parent
5787c45a03
commit
3c5c87b031
@ -59,10 +59,10 @@ newclient () {
|
|||||||
# Where to write the custom client.ovpn?
|
# Where to write the custom client.ovpn?
|
||||||
if [ -e /home/$1 ]; then # if $1 is a user name
|
if [ -e /home/$1 ]; then # if $1 is a user name
|
||||||
homeDir="/home/$1"
|
homeDir="/home/$1"
|
||||||
elif [ -e /home/${SUDO_USER} ]; then # if not, use SUDO_USER
|
elif [ ${SUDO_USER} ]; then # if not, use SUDO_USER
|
||||||
homeDir="/home/${SUDO_USER}"
|
homeDir="/home/${SUDO_USER}"
|
||||||
else # if not, use /root
|
else # if not SUDO_USER, use /root
|
||||||
homeDir="~"
|
homeDir="/root"
|
||||||
fi
|
fi
|
||||||
# Generates the custom client.ovpn
|
# Generates the custom client.ovpn
|
||||||
cp /etc/openvpn/client-template.txt $homeDir/$1.ovpn
|
cp /etc/openvpn/client-template.txt $homeDir/$1.ovpn
|
||||||
|
Loading…
Reference in New Issue
Block a user