updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / acpi-eeepc-generic / acpi-eeepc-generic-toggle-webcam.sh
blobd330cc7e373d23cda03accb8c4b9cf9c05e9d207
1 #!/bin/bash
2 # Copyright 2009 Nicolas Bigaouette
3 # This file is part of acpi-eeepc-generic.
4 # http://code.google.com/p/acpi-eeepc-generic/
6 # acpi-eeepc-generic is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # acpi-eeepc-generic is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with acpi-eeepc-generic. If not, see <http://www.gnu.org/licenses/>.
19 . /etc/acpi/eeepc/acpi-eeepc-generic-functions.sh
21 # Make sure we run as root
22 if [[ $EUID -ne 0 ]]; then
23 me="`dirname $0`/`basename $0`"
24 ${SUDO} "${me}"
25 exit 1
29 ### Information for bluetooth ###################################
30 DRIVERS=("${CAMERA_DRIVERS[@]}")
31 NAME="Camera"
32 NAME_SMALL="camera"
33 ICON="camera-web"
34 SYS_NAME="camera"
36 ### Load saved state from file ##################################
37 load_saved_state
39 ### Check /sys interface
40 check_sys_interface
42 ### Detect if card is enabled or disabled #######################
43 detect_if_enabled
45 #################################################################
46 case $1 in
47 "debug")
48 print_generic_debug
50 "restore")
51 device_restore
53 "off")
54 device_off 1
56 "on")
57 device_on 1
60 device_toggle
62 esac
64 ### End of file #################################################