Use a better client configuration file path
This commit is contained in:
parent
348608c2b4
commit
e30c8a38e7
@ -80,6 +80,9 @@ TUN needs to be enabled before running this installer."
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Store the absolute path of the directory where the script is located
|
||||||
|
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
new_client () {
|
new_client () {
|
||||||
# Generates the custom client.ovpn
|
# Generates the custom client.ovpn
|
||||||
{
|
{
|
||||||
@ -96,7 +99,7 @@ new_client () {
|
|||||||
echo "<tls-crypt>"
|
echo "<tls-crypt>"
|
||||||
sed -ne '/BEGIN OpenVPN Static key/,$ p' /etc/openvpn/server/tc.key
|
sed -ne '/BEGIN OpenVPN Static key/,$ p' /etc/openvpn/server/tc.key
|
||||||
echo "</tls-crypt>"
|
echo "</tls-crypt>"
|
||||||
} > ~/"$client".ovpn
|
} > "$script_dir"/"$client".ovpn
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ ! -e /etc/openvpn/server/server.conf ]]; then
|
if [[ ! -e /etc/openvpn/server/server.conf ]]; then
|
||||||
@ -456,7 +459,7 @@ verb 3" > /etc/openvpn/server/client-common.txt
|
|||||||
echo
|
echo
|
||||||
echo "Finished!"
|
echo "Finished!"
|
||||||
echo
|
echo
|
||||||
echo "The client configuration is available in:" ~/"$client.ovpn"
|
echo "The client configuration is available in:" "$script_dir"/"$client.ovpn"
|
||||||
echo "New clients can be added by running this script again."
|
echo "New clients can be added by running this script again."
|
||||||
else
|
else
|
||||||
clear
|
clear
|
||||||
@ -488,7 +491,7 @@ else
|
|||||||
# Generates the custom client.ovpn
|
# Generates the custom client.ovpn
|
||||||
new_client
|
new_client
|
||||||
echo
|
echo
|
||||||
echo "$client added. Configuration available in:" ~/"$client.ovpn"
|
echo "$client added. Configuration available in:" "$script_dir"/"$client.ovpn"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user