forked from keep-network/local-setup
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall-keep-core.sh
executable file
·40 lines (25 loc) · 1.07 KB
/
install-keep-core.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
#!/bin/bash
set -e
LOG_START='\n\e[1;36m' # new line + bold + color
LOG_END='\n\e[0m' # new line + reset color
DONE_START='\n\e[1;32m' # new line + bold + green
DONE_END='\n\n\e[0m' # new line + reset
WORKDIR=$PWD
printf "${LOG_START}Starting keep-core deployment...${LOG_END}"
printf "${LOG_START}Copying config files...${LOG_END}"
# Copy all config files to the right keep-core directory.
cp -R configs/keep-core/. keep-core/configs/
cd keep-core/configs
# Fill absolute paths in config file with actual working directory.
TMP_FILE=$(mktemp /tmp/config.local.1.toml.XXXXXXXXXX)
sed 's:WORKDIR:'$WORKDIR':' config.local.1.toml > $TMP_FILE
mv $TMP_FILE config.local.1.toml
printf "${LOG_START}Creating storage directories...${LOG_END}"
cd $WORKDIR
# Create storage directory for keep-core client.
mkdir -p storage/keep-core/1
printf "${LOG_START}Running install script...${LOG_END}"
cd keep-core
# Run keep-core install script. Answer with ENTER twice on emerging prompts.
printf '\n\n' | ./scripts/install.sh
printf "${DONE_START}keep-core deployed successfully!${DONE_END}"