7 DROIDCAM_V4L
="droidcam_v4l"
8 DRIVER_LOCATION
="/lib/modules/`uname -r`/kernel/drivers/media/video"
9 BUILD_SCRIPT
="/usr/share/droidcam/build_tmp"
10 [[ -z $WIDTH ]] && WIDTH
=320
11 [[ -z $HEIGHT ]] && HEIGHT
=240
14 # check if module exists
15 c
=$
(find "${DRIVER_LOCATION}" -type f
-regex ".*/${DROIDCAM_V4L}.ko" |
wc -l)
16 [[ $c -eq 0 ]] && setup
17 stat_busy
"Loading Droidcam kernel module"
20 /sbin
/modprobe
${VIDEODEV} &>/dev
/null
21 /sbin
/insmod
${DRIVER_LOCATION}/${DROIDCAM_V4L}.ko width=${WIDTH} height=${HEIGHT}
22 modprobe
${DROIDCAM_V4L} &>/dev
/null
25 if ! grep -q "^${DROIDCAM_V4L}" /proc
/modules
; then
29 add_daemon droidcam_v4l
34 stat_busy
"Unloading Droidcam kernel module"
36 if grep -q "^${DROIDCAM_V4L}" /proc
/modules
; then
37 modprobe
-r ${DROIDCAM_V4L} &>/dev
/null
40 if grep -q "^${DROIDCAM_V4L}" /proc
/modules
; then
44 rm_daemon droidcam_v4l
49 stat_busy
"Removing Droidcam kernel module"
50 find "${DRIVER_LOCATION}" -type f
-regex ".*/${DROIDCAM_V4L}.ko" -delete
56 stat_busy
"Compiling Droidcam kernel module"
57 LOG
="/tmp/droidcam-install.log"
58 if ! $BUILD_SCRIPT > $LOG 2>&1; then
59 echo "ERROR: Look at $LOG to find out what went wrong"
83 echo "usage: $0 {start|stop|restart|setup|remove}"
87 # vim: set ts=2 sw=2 noet: