-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure.sh
executable file
·46 lines (41 loc) · 1.09 KB
/
configure.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
#!/bin/sh
#
# Remove the configure environment variable file
#
rm -f .env.configure
#
# If the client_bot_info.txt file exists then convert the values
# from it so that they will be used to configure the values.
# This file is no longer used after this configuration.
#
if [ -f "client_bot_info.txt" ]; then
. ./client_bot_info.txt
if [ "$HTTPS_CHOICE" = "n" ]; then
sed -i "s/HTTPS_CHOICE.*/HTTPS_CHOICE='no'/" client_bot_info.txt
. ./client_bot_info.txt
elif [ "$HTTPS_CHOICE" = "y" ]; then
sed -i "s/HTTPS_CHOICE.*/HTTPS_CHOICE='yes'/" client_bot_info.txt
. ./client_bot_info.txt
fi
mv client_bot_info.txt .env.configure
CLIENT_NAME=$BOT_USERNAME
#
# If the input argument exists then check if it is a file
# if so it should contain a list of key=value entries.
#
elif [ -n "$1" ]; then
if [ -f "$1" ]; then
. "$1"
cp "$1" .env.configure
fi
fi
if [ -f "/usr/local/nvm/nvm.sh" ]; then
. /usr/local/nvm/nvm.sh
# nvm use 18
fi
if [ -z "$CLIENT_NAME" ];
then
node configure.js
else
WICKRIO_BOT_NAME=$CLIENT_NAME node configure.js
fi