source: build-files/ports-overlay/sysutils/uhidd/files/uhidd.in @ 58663b0

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2
Last change on this file since 58663b0 was 58663b0, checked in by Kris Moore <kris@…>, 10 months ago

Fix up next wave of ports

  • Property mode set to 100644
File size: 875 bytes
Line 
1#!/bin/sh
2#
3# $FreeBSD: sysutils/uhidd/files/uhidd.in 306606 2012-10-29 12:41:01Z crees $
4#
5
6# PROVIDE: uhidd
7# REQUIRE: DAEMON cleanvar
8# KEYWORD: nojail shutdown
9
10# Usage:
11#       uhidd start ugenX.Y     # start uhidd on device 'ugenX.Y'
12#       uhidd stop ugenX.Y      # stop uhidd on device 'ugenX.Y'
13#       uhidd start             # start uhidd on all ugen device.
14#       uhidd stop              # stop all uhidd instances.
15
16. /etc/rc.subr
17
18name=uhidd
19rcvar=uhidd_enable
20
21load_rc_config $name
22
23: ${uhidd_enable:=NO}
24
25command=%%PREFIX%%/sbin/${name}
26start_cmd=uhidd_start
27required_modules=vkbd
28pidprefix=/var/run/uhidd
29pidfile=${2+$pidprefix.`basename $2`.pid}
30
31uhidd_start()
32{
33        local dev pf
34
35        if [ -n "$1" ]; then
36                ${command} ${uhidd_flags} $1
37        else
38                for dev in /dev/ugen*; do
39                        pf="${pidprefix}.`basename ${dev}`.pid"
40                        if [ ! -f ${pf} ]; then
41                                ${command} ${uhidd_flags} ${dev}
42                        fi
43                done
44        fi
45}
46
47run_rc_command $*
Note: See TracBrowser for help on using the repository browser.