-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_private.sh
executable file
·69 lines (60 loc) · 1.16 KB
/
setup_private.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
mkdir built
mkdir .well-known
mkdir cache
cd cache
mkdir users
cd ..
mkdir cert
mkdir htmlsMin
mkdir private
cd private
if [ ! -e activationCodes.json ]; then
cat > activationCodes.json << EOF
{
"AAAA-AAAA-AAAA-AAAA": {
"used": false,
"usedOn": "",
"createdBy": "SETUP-SCRIPT",
"createdAt": "Time of setup"
}
}
EOF
fi
if [ ! -e activeUUIDs.json ]; then
cat > activeUUIDs.json << EOF
{}
EOF
fi
if [ ! -e permissions.json ]; then
cat > permissions.json << EOF
{}
EOF
fi
if [ ! -e foodConfig.json ]; then
cat > foodConfig.json << EOF
{
"foodLink": "https://sodexo.mashie.com/public/app/S%C3%B6derk%C3%B6ket/e86ce755?country=se"
}
EOF
fi
if [ ! -e secret.json ]; then
cat > secret.json << EOF
{
"secret": "123ABC"
}
EOF
fi
if [ ! -e rsa_2048_priv.pem ]; then
openssl genrsa -out rsa_2048_priv.pem 2048;
openssl rsa -pubout -in rsa_2048_priv.pem -out rsa_2048_pub.pem;
fi
cd ..
echo "See the readme for ssl key generation instructions"
# cd cert
# if [ ! -e key.pem ] || [ ! -e cert.pem ]; then
# openssl genrsa -out key.pem
# openssl req -new -key key.pem -out csr.pem
# openssl x509 -req -days 365 -in csr.pem -signkey key.pem -out cert.pem
# rm csr.pem
# fi
# cd ..