Skip to content

Instantly share code, notes, and snippets.

@endemics
Created February 24, 2010 23:59
Show Gist options
  • Save endemics/314049 to your computer and use it in GitHub Desktop.
Save endemics/314049 to your computer and use it in GitHub Desktop.
#!/bin/sh
# simple script to toggle on/off the camera of my eeepc 1000ha
camera=/sys/devices/platform/eeepc/camera
if [ `cat $camera` -eq 1 ]
then
echo -n "disabling the camera..."
echo 0 > $camera
lsusb |grep "UVC Webcam" 2>&1 >/dev/null
if [ $? -eq 1 ]
then
echo "[OK]"
else
echo "[KO]"
fi
else
echo -n "enabling the camera..."
echo 1 > $camera
lsusb |grep "UVC Webcam" 2>&1 >/dev/null
if [ $? -eq 0 ]
then
echo "[OK]"
else
echo "[KO]"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment