-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathdaemon.sh
More file actions
98 lines (82 loc) · 3.72 KB
/
daemon.sh
File metadata and controls
98 lines (82 loc) · 3.72 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env bash
###########################################
# Created by Dirty Harry for YiiMP use... #
###########################################
source /etc/functions.sh
source /etc/yiimpserver.conf
source $STORAGE_ROOT/yiimp/.yiimp.conf
source $HOME/yiimpserver/yiimp_single/.wireguard.install.cnf
set -eu -o pipefail
function print_error {
read line file <<<$(caller)
echo "An error occurred in line $line of file $file:" >&2
sed "${line}q;d" "$file" >&2
}
trap print_error ERR
echo -e " Installing BitCoin PPA...$COL_RESET"
if [ ! -f /etc/apt/sources.list.d/bitcoin.list ]; then
hide_output sudo add-apt-repository -y ppa:bitcoin/bitcoin
fi
echo -e " Installing additional system files required for daemons...$COL_RESET"
hide_output sudo apt-get update
apt_install build-essential libtool autotools-dev \
automake pkg-config libssl-dev libevent-dev bsdmainutils git libboost-all-dev libminiupnpc-dev \
libqt5gui5 libqt5core5a libqt5webkit5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev \
protobuf-compiler libqrencode-dev libzmq3-dev libgmp-dev
sudo mkdir -p $STORAGE_ROOT/yiimp/yiimp_setup/tmp
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
echo -e "$GREEN Additional System Files Completed...$COL_RESET"
echo -e " Installing Berkeley 4.8, this may take several minutes...$COL_RESET"
hide_output sudo apt-get update
hide_output apt_install libdb4.8-dev libdb4.8++-dev
echo -e "$GREEN Berkeley 4.8 Completed...$COL_RESET"
echo -e " Installing Berkeley 5.1, this may take several minutes...$COL_RESET"
hide_output sudo apt-get update
hide_output apt_install libdb5.1 libdb5.1++
echo -e "$GREEN Berkeley 5.1 Completed...$COL_RESET"
echo -e " Installing Berkeley 5.3, this may take several minutes...$COL_RESET"
hide_output sudo apt-get update
hide_output apt_install libdb5.3 libdb5.3++
echo -e "$GREEN Berkeley 5.3 Completed...$COL_RESET"
echo -e " Building OpenSSL 1.0.2g, this may take several minutes...$COL_RESET"
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
hide_output sudo wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2g.tar.gz --no-check-certificate
hide_output sudo tar -xf openssl-1.0.2g.tar.gz
cd openssl-1.0.2g
hide_output sudo ./config --prefix=$STORAGE_ROOT/openssl --openssldir=$STORAGE_ROOT/openssl shared zlib
hide_output sudo make
hide_output sudo make install
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
sudo rm -r openssl-1.0.2g.tar.gz openssl-1.0.2g
echo -e "$GREEN OpenSSL 1.0.2g Completed...$COL_RESET"
echo -e " Building bls-signatures, this may take several minutes...$COL_RESET"
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
hide_output sudo wget 'https://github.com/DirtyHarryDev/bls-signatures/releases/download/1.0/v20181101.zip'
hide_output sudo unzip v20181101.zip
cd bls-signatures-20181101
hide_output sudo cmake .
hide_output sudo make install
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
sudo rm -r v20181101.zip bls-signatures-20181101
echo -e "$GREEN bls-signatures Completed...$COL_RESET"
echo -e " Building blocknotify.sh...$COL_RESET"
if [[ ("$wireguard" == "true") ]]; then
source $STORAGE_ROOT/yiimp/.wireguard.conf
echo '###########################################
# Created by Dirty Harry for YiiMP use... #
###########################################
#!/bin/bash
blocknotify '""''"${DBInternalIP}"''""':$1 $2 $3' | sudo -E tee /usr/bin/blocknotify.sh >/dev/null 2>&1
sudo chmod +x /usr/bin/blocknotify.sh
else
echo '###########################################
# Created by Dirty Harry for YiiMP use... #
###########################################
#!/bin/bash
blocknotify 127.0.0.1:$1 $2 $3' | sudo -E tee /usr/bin/blocknotify.sh >/dev/null 2>&1
sudo chmod +x /usr/bin/blocknotify.sh
fi
echo
echo -e "$GREEN Daemon setup completed...$COL_RESET"
set +eu +o pipefail
cd $HOME/yiimpserver/yiimp_single