41
#We need a default socket location
42
if [ -z "$REMOTE_SOCKET" ]; then
43
REMOTE_SOCKET="/dev/lircd"
46
41
#For remote only detection support, we need
47
42
#both REMOTE_DEVICE and TRANSMITTER_DEVICE undefined
48
43
if [ -z "$REMOTE_DEVICE" ] && [ -z "$TRANSMITTER_DEVICE" ] && [ -c $dev ]; then
74
69
TRANSMITTER_ARGS="$*"
76
#We need a default socket location
77
if [ -z "$TRANSMITTER_SOCKET" ]; then
78
TRANSMITTER_SOCKET="/dev/lircd1"
81
71
#Transmitters must be explicitly be defined
82
72
if [ ! -z "$TRANSMITTER_DEVICE" ] || [ ! -z "$TRANSMITTER_DRIVER" ]; then
83
73
if [ -n "$TRANSMITTER_DEVICE" ] && [ "$TRANSMITTER_DEVICE" != "none" ]; then
90
80
#Now, if we ALSO have a remote defined, add some args
91
81
#To make the second lircd connect
92
82
if [ ! -z "$REMOTE_DEVICE" ] || [ ! -z "$REMOTE_DRIVER" ]; then
83
TRANSMITTER_SOCKET="${TRANSMITTER_SOCKET}1"
93
84
TRANSMITTER_ARGS="$TRANSMITTER_ARGS --connect=localhost:8765 --pidfile=/var/run/lirc/lircd1.pid"
95
86
TRANSMITTER_ARGS="--output=$TRANSMITTER_SOCKET $TRANSMITTER_ARGS"
131
122
START_IREXEC=false
125
#We need default socket locations
126
OLD_SOCKET="/dev/lircd"
127
if [ -z "$REMOTE_SOCKET" ]; then
128
REMOTE_SOCKET="/var/run/lirc/lircd"
130
if [ -z "$TRANSMITTER_SOCKET" ]; then
131
TRANSMITTER_SOCKET="/var/run/lirc/lircd"
148
146
#if we have a remote defined, it is primary process
149
147
if [ ! -z "$REMOTE_LIRCD_ARGS" ]; then
150
start-stop-daemon --start --quiet --exec /usr/sbin/lircd -- $REMOTE_LIRCD_ARGS < /dev/null
148
start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/lircd -- $REMOTE_LIRCD_ARGS < /dev/null
150
if [ -S "$REMOTE_SOCKET" -a "$OLD_SOCKET" != "$REMOTE_SOCKET" ]; then
151
rm -f $OLD_SOCKET && ln -s $REMOTE_SOCKET $OLD_SOCKET
153
154
#now if we additionally have a transmitter defined, it is secondary process
154
155
if [ ! -z "$TRANSMITTER_LIRCD_ARGS" ]; then
155
156
/usr/sbin/lircd $TRANSMITTER_LIRCD_ARGS < /dev/null
157
if [ -S "$TRANSMITTER_SOCKET" ]; then
158
rm -f ${OLD_SOCKET}1 && ln -s $TRANSMITTER_SOCKET ${OLD_SOCKET}1
157
161
elif [ ! -z "$TRANSMITTER_LIRCD_ARGS" ]; then
158
start-stop-daemon --start --quiet --exec /usr/sbin/lircd -- $TRANSMITTER_LIRCD_ARGS < /dev/null
162
start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/lircd -- $TRANSMITTER_LIRCD_ARGS < /dev/null
164
if [ -S "$TRANSMITTER_SOCKET" -a "$OLD_SOCKET" != "$TRANSMITTER_SOCKET" ]; then
165
rm -f $OLD_SOCKET && ln -s $TRANSMITTER_SOCKET $OLD_SOCKET
164
172
if [ "$START_LIRCMD" = "true" ]; then
173
[ -d "/var/run/lirc" ] || mkdir -p "/var/run/lirc"
165
174
log_daemon_msg "Starting remote control mouse daemon : LIRCMD "
166
start-stop-daemon --start --quiet --exec /usr/sbin/lircmd < /dev/null
175
start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/lircmd < /dev/null
170
179
if [ "$START_IREXEC" = "true" ]; then
180
[ -d "/var/run/lirc" ] || mkdir -p "/var/run/lirc"
171
181
log_daemon_msg "Starting execution daemon: irexec"
172
start-stop-daemon --start --quiet --exec /usr/bin/irexec -- -d /etc/lirc/lircrc < /dev/null
182
start-stop-daemon --start --quiet --oknodo --exec /usr/bin/irexec -- -d /etc/lirc/lircrc < /dev/null