-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
63 lines (39 loc) · 1.58 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
#!/bin/bash
# Quick Installer for QEWD-JSDb
# 5 February 2021
# This starts the Node-Runner Container with the correct environment settings and parameters
echo ""
echo "******* QEWD-DBjs Installer *******"
echo ""
VOLUME=${1-$PWD}
PLATFORM=$(uname -m)
# Is Docker installed?
if [ -x "$(command -v docker)" ]; then
echo "Docker is already installed"
# command
else
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install -y curl
echo "Installing docker..."
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker ${USER}
echo "Please log out and log in again, then rerun this install script"
exit 1
fi
# Create a Docker network unless it already exists
echo "Creating a Docker bridged network if necessary..."
docker network ls|grep qewd-jsdb > /dev/null || docker network create qewd-jsdb
echo "Making sure you have the latest versions of the Docker Containers..."
if [[ "$PLATFORM" != "armv"* ]]
then
docker pull rtweed/node-runner
docker pull rtweed/qewd-server
echo "running node-runner for Linux"
docker run -it --name installer --rm -v $VOLUME:/node -e "node_script=install" -e "PLATFORM=linux" -e "DOCKER_HOST=$(ip -4 addr | grep -Po 'inet \K[\d.]+')" -e "HOST_VOLUME=$VOLUME" rtweed/node-runner
else
docker pull rtweed/qewd-server-rpi
docker pull rtweed/node-runner-rpi
echo "running node-runner for Raspberry Pi"
docker run -it --name installer --rm -v $VOLUME:/node -e "node_script=install" -e "PLATFORM=arm" -e "DOCKER_HOST=$(ip -4 addr | grep -Po 'inet \K[\d.]+')" -e "HOST_VOLUME=$VOLUME" rtweed/node-runner-rpi
fi