-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathuninstall
94 lines (79 loc) · 1.96 KB
/
uninstall
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
#!/bin/bash
# Contact: <[email protected]>
# Mail: Sepapaja tn 6, Lasnamäe district, Tallinn city, Harju county, 15551, Estonia
# © minerstat OÜ in 2019
echo "================ minerstat OÜ © 2019 ================"
echo "ASIC Hub (Non-SSH) Uninstallation Script"
echo "For live chat join us on Discord: https://minerstat.com/discord"
echo
echo "Preparing.."
sleep 2
# System check
if [ "$(uname)" == "Darwin" ]; then
SYSTEM="MAC";
else
SYSTEM="LINUX";
fi
PIFETCH=$(cat /proc/device-tree/model 2> /dev/null)
if [[ $PIFETCH == *"Raspberry"* ]]; then
SYSTEM="RASPBERRY"
fi
CRONTAB=$(crontab -l | xargs -0)
if [ "$SYSTEM" = "MAC" ]; then
EXECNAME="hub-mac"
LOCATION="/usr/local/bin"
elif [ "$SYSTEM" = "LINUX" ]; then
EXECNAME="hub-linux"
LOCATION="/usr/bin"
else
EXECNAME="hub-pi"
LOCATION="/usr/bin"
fi
echo
echo "-------------------"
# Echo temporary data about software type and system
echo "= System : $SYSTEM"
echo "= Exec : $EXECNAME"
# Check it is installed
FILE="$LOCATION/$EXECNAME"
if [[ -f "$FILE" ]]; then
INSTALLED="YES"
else
INSTALLED="NO"
fi
echo "= Installed? : $INSTALLED"
echo "-------------------"
echo
if [ "$INSTALLED" = "YES" ]; then
sudo rm "$LOCATION/$EXECNAME"
fi
echo
echo "Checking for Crontabs ..."
echo "-----------------------"
#if [[ $CRONTAB == *"$EXECNAME"* ]]; then
if [[ $CRONTAB == *"hub-"* ]]; then
echo "= Removing crontabs"
crontab -l > cron
if [ "$SYSTEM" = "MAC" ]; then
echo "= “Terminal” would like to administer your computer. Administration can include modifying passwords, networking and system settings."
echo "= CLICK on [OK]"
fi
sed -i.bak '/hub-/d' ./cron
crontab cron
rm cron
fi
#fi
echo
echo "-------------"
echo "Uninstallation finished."
echo "-------------"
echo
sleep 4
clear
echo
echo "-------------"
echo "Uninstallation finished."
echo "-------------"
echo "Need assistance? "
echo "You can find us on https://minerstat.com/discord (contact person: coinscrow#0001)."
echo