-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.sh
executable file
·47 lines (42 loc) · 952 Bytes
/
bootstrap.sh
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!bash
# Created by Lee, Jun Seok <[email protected]> at Aug 2, 2020
DIR=$(dirname $0)
if [ -f "$(which python)" ]; then
python --version
else
echo python is not found
exit
fi
if [ -f "$(which docker)" ]; then
docker --version
else
echo docker is not found
exit
fi
if [ -f "$(which docker-compose)" ]; then
docker-compose --version
else
echo docker-compose is not found
exit
fi
echo
echo Create .config, .env
DOTCONFIG=$DIR/.config
DOTENV=$DIR/.env
if [ -f "$DOTCONFIG" ]; then
echo $DOTCONFIG exists. Skipping...
else
cp $DIR/.config.dist $DOTCONFIG
fi
if [ -f "$DOTENV" ]; then
echo $DOTENV exists. Skipping...
else
cp $DIR/.env.dist $DOTENV
fi
echo Create file compose/traefik/acme.json permission 600
touch $DIR/compose/traefik/acme.json
sudo chmod 600 $DIR/compose/traefik/acme.json
echo
echo Generate WG_SECRETKEY and WG_UPGRADEKEY...
./keygen.py
echo Copy and paste these keys in .config