forked from lenovo/lenovo-wwan-unlock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fcc_unlock_uninstall.sh
executable file
·83 lines (74 loc) · 1.83 KB
/
fcc_unlock_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
#! /bin/bash
echo "Uninstalling fcc unlock pakage"
if [ -d "/opt/fcc_lenovo" ]
then
sudo rm -rf /opt/fcc_lenovo
fi
### Identify current OS
OS_UBUNTU="Ubuntu"
OS_FEDORA="Fedora"
source /etc/os-release
if [[ "$NAME" == *"$OS_UBUNTU"* ]]
then
if [ -d "/usr/lib/x86_64-linux-gnu/ModemManager/fcc-unlock.d" ]
then
sudo rm -rf /usr/lib/x86_64-linux-gnu/ModemManager/fcc-unlock.d
fi
if [ -e "/usr/lib/libmodemauth.so" ]
then
sudo rm -rf /usr/lib/libmodemauth.so
fi
if [ -e "/usr/lib/libconfigserviceR+.so" ]
then
sudo rm -rf /usr/lib/libconfigserviceR+.so
fi
if [ -e "/usr/lib/libconfigservice350.so" ]
then
sudo rm -rf /usr/lib/libconfigservice350.so
fi
if [ -e "/usr/lib/libmbimtools.so" ]
then
sudo rm -rf /usr/lib/libmbimtools.so
fi
elif [[ "$NAME" == *"$OS_FEDORA"* ]]
then
if [ -d "/usr/lib64/ModemManager/fcc-unlock.d" ]
then
sudo rm -rf /usr/lib64/ModemManager/fcc-unlock.d
fi
if [ -e "/usr/lib64/libmodemauth.so" ]
then
sudo rm -rf /usr/lib64/libmodemauth.so
fi
if [ -e "/usr/lib/libconfigserviceR+.so" ]
then
sudo rm -rf /usr/lib/libconfigserviceR+.so
fi
if [ -e "/usr/lib/libconfigservice350.so" ]
then
sudo rm -rf /usr/lib/libconfigservice350.so
fi
if [ -e "/usr/lib/libmbimtools.so" ]
then
sudo rm -rf /usr/lib/libmbimtools.so
fi
else
exit 0
fi
## Delete SAR config service
if [ -e "/etc/systemd/system/lenovo-cfgservice.service" ]
then
sudo rm -rf /etc/systemd/system/lenovo-cfgservice.service
fi
sudo systemctl daemon-reload
PACKAGE_DIR=$(dirname "$0")
source "$PACKAGE_DIR"/suspend-fix/install.sh
# Delete the drop-in file if it exists
if [ -f "$MM_DROPIN_DIR/$MM_DROPIN_FILENAME" ]; then
sudo rm -f "$MM_DROPIN_DIR/$MM_DROPIN_FILENAME"
sudo systemctl daemon-reload
sudo systemctl restart ModemManager.service
fi
echo "fcc unlock package is uninstalled"
### Exit script
exit 0