From b2f192faabe412adce79534e22efe9fb69ee40e2 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 21 Jul 2006 10:10:31 +0000 Subject: Rename /openembedded/ -> /meta/ git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- meta/packages/irda-utils/files/init | 72 +++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 meta/packages/irda-utils/files/init (limited to 'meta/packages/irda-utils/files') diff --git a/meta/packages/irda-utils/files/init b/meta/packages/irda-utils/files/init new file mode 100755 index 0000000000..9becfcc0ed --- /dev/null +++ b/meta/packages/irda-utils/files/init @@ -0,0 +1,72 @@ +#! /bin/sh + +module_id() { + awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' /etc/sysconfig/irda + if [ $IRDA = "yes" ]; then + echo "DEVICE=$DEVICE" >> /etc/sysconfig/irda + echo "DONGLE=$DONGLE" >> /etc/sysconfig/irda + echo "DISCOVERY=$DISCOVERY" >> /etc/sysconfig/irda + fi +fi + +. /etc/sysconfig/irda + +# Check that irda is up. +[ ${IRDA} = "no" ] && exit 0 + +[ -f /usr/sbin/irattach ] || exit 0 + +ARGS= +if [ $DONGLE ]; then + ARGS="$ARGS -d $DONGLE" +fi +if [ "$DISCOVERY" = "yes" ];then + ARGS="$ARGS -s" +fi + +case "$1" in + start) + echo -n "Starting IrDA: " + irattach ${DEVICE} ${ARGS} > /dev/null 2>&1 & + echo "$NAME." + ;; + stop) + echo -n "Stopping IrDA: " + killall irattach > /dev/null 2>&1 + echo "$NAME." + ;; + restart|force-reload) + echo -n "Restarting IrDA: " + irattach ${DEVICE} ${ARGS} > /dev/null 2>&1 & + sleep 1 + killall irattach > /dev/null 2>&1 + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + -- cgit v1.2.3