-
Notifications
You must be signed in to change notification settings - Fork 0
/
androidxmrig.sh
113 lines (83 loc) · 2.67 KB
/
androidxmrig.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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash
UPDATE=0
UPDATEALL=0
GITDIR="/data/data/com.termux/files/home/git"
HWLOCDIR="$GITDIR/hwloc"
XMRIGDIR="$GITDIR/xmrig"
help_screen() {
echo " "
echo "AndroidXmrig For DERO v0.1.0 (Fats Waller)"
echo " "
echo "Usage:"
echo " ./androidxmrig.sh [options]"
echo " "
echo "Options: "
echo " --update-all, Update all dependencies and latest xmrig version."
echo " -h|--help, This help screen."
echo " "
exit
}
git_and_build_hwloc() {
if [[ ! -d "$GITDIR" ]]; then
mkdir "$GITDIR"
fi
if [[ -d "$HWLOCDIR" ]]; then
rm -rf "$HWLOCDIR"
fi
cd "$GITDIR"
git clone https://github.com/open-mpi/hwloc
cd hwloc
./autogen.sh && ./configure && make
}
compile_xmrig() {
if [[ -f "xmrig" ]]; then
echo -ne "Removing old soft-link..."
rm xmrig
sleep 1
echo "Done."
fi
echo "Upgrading system dependencies... (You will need to respond to the prompts)"
termux-change-repo
apt-get full-upgrade -y
apt-get -q -y install autoconf automake cmake git libtool binutils
if [[ ! -d "$GITDIR" ]]; then
mkdir "$GITDIR"
fi
cd "$GITDIR"
if [[ -d "$XMRIGDIR" ]]; then
rm -rf xmrig
fi
if [[ ! -d "$HWLOCDIR" ]] || [[ $UPDATEALL -eq 1 ]]; then
git_and_build_hwloc
fi
cd "$GITDIR"
git clone https://github.com/freQniK/xmrig
cd "$XMRIGDIR" && mkdir build && cd build
cmake .. -DHWLOC_INCLUDE_DIR=/data/data/com.termux/files/home/git/hwloc/include -DHWLOC_LIBRARY=/data/data/com.termux/files/home/git/hwloc/hwloc/.libs/libhwloc.so
make
echo "Done."
cd /data/data/com.termux/files/home
ln -s /data/data/com.termux/files/home/git/xmrig/build/xmrig xmrig
echo "Run: ./derominers.sh OR ./herominers.sh"
}
while [ "$#" -gt 0 ]; do
key=${1}
case ${key} in
--update)
UPDATE=1
shift
;;
--update-all)
UPDATEALL=1
shift
;;
-h|--help)
help_screen
shift
;;
*)
shift
;;
esac
done
compile_xmrig