forked from akash-network/awesome-akash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
42 lines (34 loc) · 884 Bytes
/
entrypoint.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
#!/usr/bin/env bash
remove_quotes() {
local str="$1"
str="${str%\"}"
str="${str#\"}"
echo "$str"
}
for var_name in OPTIONS; do
eval "value=\$$var_name"
value=$(remove_quotes "$value")
if [ -z "$value" ]; then
echo "Please examine the SDL and be sure to set $var_name."
sleep 300
exit
else
eval "$var_name=\"$value\""
fi
done
# Check if bminer is already downloaded
if [ ! -f "/root/bminer" ]; then
ASSET_URL="https://www.bminercontent.com/releases/bminer-v16.4.11-2849b5c-amd64.tar.xz"
wget $ASSET_URL -O /root/bminer.tar.xz
# Extract to the current directory without the top-level folder
tar --strip-components=1 -xf /root/bminer.tar.xz -C .
# Delete the downloaded archive
rm /root/bminer.tar.xz
chmod +x /root/bminer
fi
echo "Startup takes up to ~60 seconds"
while :
do
/root/bminer $OPTIONS
sleep 1
done