Lines 7-12
Link Here
|
7 |
# Add the following line to /etc/rc.conf[.local] to enable webcamd: |
7 |
# Add the following line to /etc/rc.conf[.local] to enable webcamd: |
8 |
# |
8 |
# |
9 |
# webcamd_enable="YES" |
9 |
# webcamd_enable="YES" |
|
|
10 |
# webcamd_device="ugenX.X" |
10 |
# |
11 |
# |
11 |
|
12 |
|
12 |
webcamd_enable=${webcamd_enable-"NO"} |
13 |
webcamd_enable=${webcamd_enable-"NO"} |
Lines 20-39
Link Here
|
20 |
command_args="-B -U webcamd -G webcamd" |
21 |
command_args="-B -U webcamd -G webcamd" |
21 |
|
22 |
|
22 |
start_precmd="${name}_prestart" |
23 |
start_precmd="${name}_prestart" |
|
|
24 |
start_postcmd="${name}_fixpidfile" |
25 |
stop_precmd="${name}_check_vars" |
23 |
|
26 |
|
24 |
webcamd_prestart() |
27 |
webcamd_prestart() |
25 |
{ |
28 |
{ |
26 |
if checkyesno hald_enable ; then |
29 |
if checkyesno hald_enable ; then |
27 |
command_args="$command_args -H" |
30 |
command_args="$command_args -H" |
28 |
fi |
31 |
fi |
|
|
32 |
webcamd_check_vars |
29 |
} |
33 |
} |
30 |
|
34 |
|
31 |
pidfile="/var/run/webcamd.*.0.pid" |
35 |
webcamd_check_vars() |
|
|
36 |
{ |
37 |
if [ $# -gt 1 ]; then |
38 |
webcamd_device="$2" |
39 |
elif [ "x${webcamd_device}" = "x" ]; then |
40 |
warn "You should set webcamd_device before running this" |
41 |
return 1 |
42 |
fi |
43 |
command_args="$command_args -d ${webcamd_device} -i 0" |
44 |
pidfile="/var/run/webcamd.${webcamd_device##ugen}.0.pid" |
45 |
} |
46 |
|
47 |
webcamd_fixpidfile() |
48 |
{ |
49 |
read pid < $pidfile |
50 |
pid="$(expr $pid + 1)" |
51 |
echo -n "$pid" > $pidfile |
52 |
} |
32 |
|
53 |
|
33 |
load_rc_config $name |
54 |
load_rc_config $name |
34 |
if [ $# -gt 1 ]; then |
55 |
run_rc_command $1 |
35 |
pidfile="webcamd.dummy" |
|
|
36 |
command_args="$command_args -d $2 -i 0" |
37 |
# Only run the rc command if the appropriate arguments are specified: |
38 |
run_rc_command $1 |
39 |
fi |