forked from cryptopool-builders/Multi-Pool-Installer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbootstrap.sh
55 lines (47 loc) · 1.41 KB
/
bootstrap.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
#!/bin/bash
#########################################################
# Source https://mailinabox.email/ https://github.com/mail-in-a-box/mailinabox
# Updated by cryptopool.builders for crypto use...
# This script is intended to be run like this:
#
# curl https://raw.githubusercontent.com/cryptopool-builders/Multi-Pool-Installer/master/bootstrap.sh | sudo bash
#
#########################################################
if [ -z "$TAG" ]; then
TAG=v1.0
fi
# Are we running as root?
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Did you leave out sudo?"
exit
fi
# Clone the MultiPool repository if it doesn't exist.
if [ ! -d $HOME/multipool ]; then
if [ ! -f /usr/bin/git ]; then
echo Installing git . . .
apt-get -q -q update
DEBIAN_FRONTEND=noninteractive apt-get -q -q install -y git < /dev/null
echo
fi
echo Downloading MultiPool Installer $TAG. . .
git clone \
-b $TAG --depth 1 \
https://github.com/cryptopool-builders/multipool_setup \
$HOME/multipool/install \
< /dev/null 2> /dev/null
echo
fi
# Change directory to it.
cd $HOME/multipool/install
# Update it.
if [ "$TAG" != `git describe --tags` ]; then
echo Updating MultiPool Installer to $TAG . . .
git fetch --depth 1 --force --prune origin tag $TAG
if ! git checkout -q $TAG; then
echo "Update failed. Did you modify something in `pwd`?"
exit
fi
echo
fi
# Start setup script.
sudo bash $HOME/multipool/install/start.sh