-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_functions.sh
59 lines (43 loc) · 1.65 KB
/
install_functions.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
auth_zero () {
echo $ENV_FOLDER
cp $ENV_FOLDER/.env.sample $ENV_FOLDER/.env
echo "What is your Auth0 API Url Identifier? (e.g. http://labyrinth/labyrinth)" # APIURL
read;
sed -i "s|=API_URL|=$REPLY|" $ENV_FOLDER/.env
echo "What is your Auth0 Domain? e.g. dev-xxxxx.auth0.com " # AUTH0DOMAIN
read;
sed -i "s|=AUTH0_DOMAIN|=$REPLY|" $ENV_FOLDER/.env
echo "Enter the key to receive telegraf metrics? E.g. 1234" # TELEGRAF_KEY
read;
sed -i "s|=TELEGRAF_KEY|=$REPLY|" $ENV_FOLDER/.env
}
auth_config () {
cp $AUTH0JSON_FOLDER/auth_config.json.sample $AUTH0JSON_FOLDER/auth_config.json
echo "What is your Auth0 Client Id?" #clientId
read;
sed -i "s|CLIENTID|\"$REPLY\"|" $AUTH0JSON_FOLDER/auth_config.json
sed -i "s|AUDIENCE|\"$AUTHAPIURL\"|" $AUTH0JSON_FOLDER/auth_config.json
sed -i "s|DOMAIN|\"$AUTH0DOMAIN\"|" $AUTH0JSON_FOLDER/auth_config.json
}
alertmanager() {
echo "What is your email server? e.g. localhost:25 (Press Enter to skip)"
read;
if [ -z "$REPLY" ]; then
echo "Skipping alertmanager configuration..."
else
cp $ALERTMANAGER_FOLDER/alertmanager.sample.yml $ALERTMANAGER_FOLDER/alertmanager.yml
sed -i "s|SMARTHOST:25|$REPLY|" $ALERTMANAGER_FOLDER/alertmanager.yml
echo "Who is your Email from?"
read;
sed -i "s|MAILFROM|$REPLY|" $ALERTMANAGER_FOLDER/alertmanager.yml
echo "What is your email username?"
read;
sed -i "s|SMTPUSER|$REPLY|" $ALERTMANAGER_FOLDER/alertmanager.yml
echo "What is your email password?"
read;
sed -i "s|SMTPPASSWORD|$REPLY|" $ALERTMANAGER_FOLDER/alertmanager.yml
echo "What email should alerts go to by default?"
read;
sed -i "s|MAILTO|$REPLY|" $ALERTMANAGER_FOLDER/alertmanager.yml
fi
}