summaryrefslogtreecommitdiff
path: root/src/irbox.init
blob: 1fa91c4d8c04b7b9d2a5e2a4c07499795e9f6441 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
#
# irbox:       Starts the irbox Ivy agent
#
# Version:      @(#) /etc/rc.d/init.d/irbox.init 1.0
#
# chkconfig: - 98 02
# description: This is a daemon that drives an Irman infra-red device and \
#              emits its events on an Ivy bus
# processname: irbox
# config: /etc/irbox.conf

# Source function library.
. /etc/rc.d/init.d/functions

. /etc/irbox.conf

if [ -z $BUS ]; then
  busopt=
else
  busopt="-b $BUS"
fi

if [ -z $DEVICE ]; then
  devopt=
else
  devopt="-d $DEVICE"
fi

if [ -z $APPNAME ]; then
  appopt=
else
  appopt="-n $APPNAME"
fi



# See how we were called.
case "$1" in
  start)
	echo -n "Infra-red Ivy driver... "
	daemon irbox  $busopt $devopt $appopt &
	echo
	touch /var/lock/subsys/irbox
	;;
  stop)
	echo -n "Shutting down Infra-red Ivy driver: "
	killproc irbox
	rm -f /var/lock/subsys/irbox
	echo
	;;
  status)
	status irbox
	;;
  reload)
	killproc -HUP irbox
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "*** Usage: irbox {start|stop|status|restart¦reload}"
	exit 1
esac

exit 0