-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultimn_install.sh
More file actions
61 lines (49 loc) · 2.89 KB
/
multimn_install.sh
File metadata and controls
61 lines (49 loc) · 2.89 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
#!/bin/bash
readonly GRAY='\e[1;30m'
readonly GREEN='\e[1;32m'
readonly YELLOW='\e[1;33m'
readonly CYAN='\e[1;36m'
readonly NC='\e[0m'
function echo_json_upd() {
echo -e "$1"
[[ -t 3 ]] && echo -e "{\"message\":\"$(echo "$1" | sed 's/\\e\[[0-9;]*m//g')\",\"retcode\":$2}" >&3
}
echo -e "\n====================================================================================\
\n ${GRAY}███╗ ███╗ ██╗ ██╗ ██╗ ████████╗ ██████╗ ${NC}███╗ ███╗███╗ ██╗ \
\n ${GRAY}████╗ ████║ ██║ ██║ ██║ ╚══██╔══╝ ╚═██╔═╝ ${NC}████╗ ████║████╗ ██║ \
\n ${GRAY}██╔████╔██║ ██║ ██║ ██║ ██║ ██║ ${NC}██╔████╔██║██╔██╗ ██║ \
\n ${GRAY}██║╚██╔╝██║ ██║ ██║ ██║ ██║ ██║ ${NC}██║╚██╔╝██║██║╚██╗██║ \
\n ${GRAY}██║ ╚═╝ ██║ ╚██████╔╝ ██████╗ ██║ ██████╗ ${NC}██║ ╚═╝ ██║██║ ╚████║ \
\n ${GRAY}╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ${NC}╚═╝ ╚═╝╚═╝ ╚═══╝ \
\n ╗ made by ${GREEN}HelioCoin${NC} ╔\
\n Credit: ${YELLOW}Credit for this script to neo3587${NC}\
\n Source: ${CYAN}https://github.com/almightyhelp/Helio-MNScript${NC}\
\n====================================================================================\
\n "
multimn_update=$(curl -s https://raw.githubusercontent.com/almightyhelp/Helio-MNScript/master/multimn.sh)
if [[ -f /usr/bin/multimn && ! $(diff -q <(echo "$multimn_update") /usr/bin/multimn) ]]; then
echo_json_upd "${GREEN}multimn${NC} is already updated to the last version" 0
else
echo -e "Checking needed dependencies..."
if [[ ! $(command -v lsof) ]]; then
echo -e "Installing ${CYAN}lsof${NC}..."
sudo apt-get install lsof
fi
if [[ ! $(command -v curl) ]]; then
echo -e "Installing ${CYAN}curl${NC}..."
sudo apt-get install curl
fi
if [[ ! -d ~/.multimn ]]; then
mkdir ~/.multimn
fi
touch ~/.multimn/multimn.conf
update=$([[ -f /usr/bin/multimn ]] && echo "1" || echo "0")
echo "$multimn_update" > /usr/bin/multimn
chmod +x /usr/bin/multimn
if [[ $update == "1" ]]; then
echo_json_upd "${GREEN}multimn${NC} updated to the last version, pretty fast, right?" 1
else
echo_json_upd "${GREEN}multimn${NC} installed, pretty fast, right?" 2
fi
fi
echo ""