forked from dev47apps/droidcam-linux-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall
executable file
·29 lines (25 loc) · 853 Bytes
/
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
#!/usr/bin/env bash
#
if (lsmod | grep v4l2loopback_dc); then
echo "Removing video device"
rmmod v4l2loopback_dc
rm -f /lib/modules/`uname -r`/kernel/drivers/media/video/v4l2loopback-dc.ko
fi
echo "Removing files"
sudo rm -f /usr/bin/droidcam*
sudo rm -f /usr/local/bin/droidcam*
sudo rm -f /usr/share/applications/droidcam.desktop
sudo xdg-desktop-menu uninstall droidcam.desktop
etc_modules() {
# Remove droidcam reference in /etc/modules
cat /etc/modules | egrep -v "^(videodev|v4l2loopback_dc)" > /tmp/.etc.modules
prevperm=`stat -c %a /etc/modules`
sudo mv /tmp/.etc.modules /etc/modules
sudo chmod $prevperm /etc/modules
}
echo "Cleaning DroidCam configs"
[[ -e "/etc/modules" ]] && etc_modules
rm -f /etc/modprobe.d/droidcam.conf || true
rm -f /etc/modules-load.d/droidcam.conf || true
rm -rf /opt/droidcam*
echo "Completed"