Ahenk/usr/share/ahenk/plugins/usb/scripts/DISABLED_webcam.sh

24 lines
263 B
Bash
Raw Normal View History

#!/bin/bash
var=$(lsof -t /dev/video0)
if [[ -z "$var" ]]
then
echo "Webcam is not in use"
else
kill -9 "$var"
sleep 2
fi
var=$(lsmod | awk '{print $1}'| grep uvcvideo)
if [[ -z "$var" ]]
then
echo "Webcam is already blocked"
else
rmmod uvcvideo
sleep 2
fi