-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.sh
87 lines (65 loc) · 1.98 KB
/
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
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
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# De-Autostart:
echo "Entferne Autostart..."
if rm "/home/${SUDO_USER}/.config/autostart/FeinkostBarcodeScanner.desktop"; then
echo -e " -> OK\n"
else
echo " -> FAILED"
fi
echo "Entferne Programmdateien..."
if rm -r "/home/${SUDO_USER}/Barcode-Scanner-Feinkost-/"; then
echo -e " -> OK\n"
else
echo " -> WARNING: FAILED"
fi
echo "Entferne die Abhängigkeiten..."
echo "Entferne Driver..."
if sudo apt remove tdsodbc freetds-dev freetds-bin unixodbc-dev; then
echo -e " -> OK\n"
else
echo " -> FAILED --> SKIPPING()"
fi
echo "Entferne Driver File..."
# Save driver Location for Driver Loader
if sudo rm "/etc/odbcinst.ini"; then
echo -e " -> OK\n"
else
echo " -> FAILED"
fi
echo "Entferne Driver Loader..."
# 2. Driver Loader, 3. Graphics, 4. Python-modules:
if sudo apt remove python3-pyodbc; then
echo -e " -> OK\n"
else
echo " -> FAILED --> SKIPPING()"
fi
echo "Entferne Qt-Bibliotheken"
if sudo apt remove python3-PySide6.*; then
echo -e " -> OK\n"
else
echo " -> FAILED --> SKIPPING()"
fi
#echo "Deaktiviere Feature Herunterfahren und Neustarten über Webserver..."
#if text="$(sudo cat "/etc/sudoers" | grep -v "${SUDO_USER} ALL=(ALL) NOPASSWD: /sbin/reboot, /sbin/shutdown" )"; then
# [ -e "/etc/sudoers.bak" ] && sudo rm "/etc/sudoers.bak" && echo "Lösche altes Backup"
# if sudo mv "/etc/sudoers" "/etc/sudoers.bak"; then
# if echo "$text" | sudo tee "/etc/sudoers"; then
# echo -e " -> OK\n"
# else
# echo " -> FAILED to write new file -> restore..."
# [ -e "/etc/sudoers" ] && sudo rm "/etc/sudoers"
# sudo mv "/etc/sudoers.bak" "/etc/sudoers"
# fi
# else
# echo " -> FAILED to create backup -> restore..."
# [ -e "/etc/sudoers" ] && sudo rm "/etc/sudoers"
# sudo mv "/etc/sudoers.bak" "/etc/sudoers"
# fi#
#else
# echo " -> FAILED grep failed skipp"
#fi
echo -e "\nFINISHED"