-
Notifications
You must be signed in to change notification settings - Fork 15
/
install.sh
executable file
·69 lines (59 loc) · 2.01 KB
/
install.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
if [ -z "$TRIPLET" ]
then
echo "Auto Detect"
if [ "$(uname -m)" == "arm64" ]; then
echo "ARM Chip found"
if [ "$(sysctl -n machdep.cpu.brand_string)" == "Apple M1" ]; then
echo "M1 ARM detected"
export TRIPLET="aarch64-linux-gnu"
else
export TRIPLET="arm64-linux-gnu"
fi
elif [ "$(uname -m)" == "x86_64" ]; then
#echo 'You must provide TRIPLET as first parameter'
#echo './install.sh x86_64-linux-gnu'
export TRIPLET="x86_64-linux-gnu"
fi
else
: ${TRIPLET:=$TRIPLET}
: ${services:=Null}
fi
echo "TRIPLET="$TRIPLET
if [ ! -z "$services" ]; then
echo "services="$services
fi
type -P docker-compose && docker-compose down || docker compose down
$(which python3) plebnet_generate.py TRIPLET=$TRIPLET services=$services
if [ "$RESET" == "true" ]; then
read -p "Clobber volumes directory - This will destroy private keys!!! (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo rm -rf volumes
fi
fi
#Create data directories
mkdir -p volumes
mkdir -p volumes/lnd_datadir
mkdir -p volumes/cln_datadir
mkdir -p volumes/bitcoin_datadir
mkdir -p volumes/thub_datadir
mkdir -p volumes/rtl_datadir
mkdir -p volumes/tor_datadir
mkdir -p volumes/tor_servicesdir
mkdir -p volumes/tor_torrcdir
mkdir -p volumes/lndg_datadir
mkdir -p volumes/postgres_datadir
mkdir -p volumes/lnbits_datadir
#REF: https://docs.docker.com/engine/install/linux-postinstall
while ! docker system info > /dev/null 2>&1; do
echo "Waiting for docker to start..."
if [[ "$(uname -s)" == "Linux" ]]; then
systemctl restart docker.service
fi
if [[ "$(uname -s)" == "Darwin" ]]; then
open --background -a /./Applications/Docker.app/Contents/MacOS/Docker
fi
sleep 1;
done
type -P docker-compose && docker-compose build --build-arg TRIPLET=$TRIPLET || docker compose build --build-arg TRIPLET=$TRIPLET
type -P docker-compose && docker-compose up --remove-orphans -d || docker compose up --remove-orphans -d