-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbootstrap_upgrade.sh
43 lines (35 loc) · 1.16 KB
/
bootstrap_upgrade.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
#!/usr/bin/env bash
#########################################################
# Source https://mailinabox.email/ https://github.com/mail-in-a-box/mailinabox
# Updated by afiniel for crypto use...
# This script is intended to be ran from the yiimpool installer
#########################################################
if [ -z "${TAG}" ]; then
TAG=v2.0
fi
# Clone the yiimpool repository if it doesn't exist.
if [ ! -d $HOME/yiimpool/yiimp_upgrade ]; then
echo Downloading yiimpool YiiMP Stratum Upgrade Installer ${TAG}. . .
git clone \
-b ${TAG} --depth 1 \
https://github.com/Afiniel-tech/yiimpool_yiimp_upgrade \
$HOME/yiimpool/yiimp_upgrade \
< /dev/null 2> /dev/null
echo
fi
# Change directory to it.
cd $HOME/yiimpool/yiimp_upgrade
# Update it.
sudo chown -R $USER $HOME/yiimpool/install/.git/
if [ "${TAG}" != `git describe --tags` ]; then
echo Updating yiimpool YiiMP Stratum Upgrade 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.
cd $HOME/yiimpool/yiimp_upgrade || exit
source start.sh