-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·31 lines (25 loc) · 1.21 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·31 lines (25 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
#....
# Make sure only root can run our script
if [ "$(id -u)" == "0" ]; then
echo "This script must be run not as root" 1>&2
exit 1
fi
# Dont require any more?
# vagrant -v > /dev/null 2>&1 || { echo "Vagrant is required but it's not installed. Aborting." >&2; exit 1; }
# ansible --version > /dev/null 2>&1 || { echo "Ansible is required but it's not installed. Aborting." >&2; exit 1; }
# vagrant plugin list | grep vbguest > /dev/null 2>&1 || { echo "Vagrant vbguest plugin is required but it's not installed. Aborting." >&2; exit 1; }
if [ ! -f ./easy-rsa/easyrsa3/easyrsa ]; then
echo "easy-rsa not found! Plz run: `git submodule init && git submodule update` to update source modules"; exit 1;
fi
echo "Preparing crypto keys for our project"
echo "We need init pki env and generate server and client certificates and keys"
echo "You should choose new password for ca cert and use it througout the procedure"
echo "Ready? Hit [Enter]" && read
cd ./easy-rsa/easyrsa3/ && ./easyrsa init-pki &&
./easyrsa build-ca &&
./easyrsa gen-req server nopass && ./easyrsa gen-req client nopass &&
./easyrsa sign-req server server && ./easyrsa sign-req client client &&
./easyrsa gen-dh
# Not so fast plz
# vagrant up