aboutsummaryrefslogtreecommitdiff
path: root/network/irda-utils/rc.irda.new
diff options
context:
space:
mode:
Diffstat (limited to 'network/irda-utils/rc.irda.new')
-rw-r--r--network/irda-utils/rc.irda.new46
1 files changed, 46 insertions, 0 deletions
diff --git a/network/irda-utils/rc.irda.new b/network/irda-utils/rc.irda.new
new file mode 100644
index 0000000000000..88b62eff0a641
--- /dev/null
+++ b/network/irda-utils/rc.irda.new
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# Start/stop/restart the irda daemon:
+#
+# This script is based on irda-utils' sysv-init script and
+# only covers SIR mode. For detailed instructionis on how
+# to enable FIR mode see 'man 8 irattach' and README.irattach
+# in the doc directory.
+
+# You probably have to choose a different serial port (/dev/ttyS?).
+DEVICE=/dev/ttyS1
+DISCOVERY=yes
+#DONGLE=actisys+
+
+[ -f /usr/sbin/irattach ] || exit 0
+
+ARGS=
+if [ $DONGLE ]; then
+ ARGS="$ARGS -d $DONGLE"
+fi
+if [ "$DISCOVERY" = "yes" ];then
+ ARGS="$ARGS -s"
+fi
+
+# See how we were called.
+case "$1" in
+ start)
+ # Attach irda device
+ echo "Starting IrDA: /usr/sbin/irattach"
+ /usr/sbin/irattach ${DEVICE} ${ARGS}
+ ;;
+ stop)
+ # Stop service.
+ echo "Stopping IrDA... "
+ killall irattach
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: irda {start|stop|restart}"
+ exit 1
+esac
+
+exit 0