Skip to content

Commit

Permalink
fix: forget to import and check if tls-auth.key exist
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincaradant committed Jan 31, 2016
1 parent 0064ed8 commit c8a973f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 11 additions & 1 deletion makeOVPN.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,22 @@ if [ ! -f easyrsa3/pki/private/$NAME$KEY ]; then
fi
echo "Client’s Private Key found: $NAME$KEY"


#Confirm the tls-key key exists
if [ ! -f easyrsa3/tls-auth.key ]; then
echo "[ERROR]: tls-auth Key not found: tls-auth.key"
exit
fi
echo "tls-auth Key found: tls-auth.key"

#Confirm the CA public key exists
if [ ! -f easyrsa3/pki/$CA ]; then
echo "[ERROR]: CA Public Key not found: $CA"
exit
fi
echo "CA public Key found: $CA"
echo "CA public Key found: $CA"



#Confirm the tls-auth ta key file exists

Expand Down
5 changes: 2 additions & 3 deletions scriptVPN.sh
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ push "dhcp-option DNS 8.8.4.4"
ca ca.crt
cert $namevpn.crt
key $namevpn.key
tls-auth ./tls-auth.key 0
tls-auth tls-auth.key 0
dh dh.pem
sndbuf $bufferOpenvpn
rcvbuf $bufferOpenvpn
Expand Down Expand Up @@ -761,15 +761,14 @@ EOF
cp pki/private/$nameclient.key /etc/openvpn/client/$nameclient
cp pki/issued/$nameclient.crt /etc/openvpn/client/$nameclient
cp pki/reqs/$nameclient.req /etc/openvpn/client/$nameclient
cp tls-auth.key /etc/openvpn/client/$nameclient

# start the script to create the client
cd /etc/openvpn
./makeOVPN.sh $nameclient $buffer
chmod 755 -R /etc/openvpn
chmod 755 -R /etc/openvpn/easyrsa3/pki
unset nameclient

#loop=1
;;

"3" )
Expand Down

0 comments on commit c8a973f

Please sign in to comment.