forked from mccdaq/daqhats
-
Notifications
You must be signed in to change notification settings - Fork 3
/
uninstall.sh
executable file
·47 lines (38 loc) · 865 Bytes
/
uninstall.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
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root, i.e 'sudo ./uninstall.sh'" 1>&2
exit 1
fi
# Remove the C library and headers
echo "Removing shared library"
echo
make -C lib uninstall
echo
# Removed compiled examples
echo "Removing compiled examples"
echo
make -C examples/c clean
echo
# Remove tools
echo "Removing tools"
echo
make -C tools uninstall
echo
# Remove EEPROM images
echo "Removing EEPROM images"
rm -rf /etc/mcc/hats
echo
# Remove the Python packages
num=$(pip2 show daqhats | wc -l)
if [ "$num" -ne 0 ]; then
echo "Removing Python 2 package"
pip2 uninstall daqhats -y
echo
fi
num=$(pip3 show daqhats | wc -l)
if [ "$num" -ne 0 ]; then
echo "Removing Python 3 package"
pip3 uninstall daqhats -y
echo
fi
echo "Uninstall complete. Remove this folder to completely remove daqhats."