/etc/init.d/irda-utils is in irda-utils 0.9.18-12ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | #!/bin/sh
### BEGIN INIT INFO
# Provides: irda irda-utils
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Infrared port support
# Description: Init script for irda-utils: manage start and stop of
# irattach and setup some other items.
### END INIT INFO
# Authors: Sebastian Henschel <shensche@debian.org>
# Alberto Gonzalez Iniesta <agi@inittab.org>
set -e
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
DAEMON="/usr/sbin/irattach"
NAME="irattach"
PIDFILE="/var/run/$NAME.pid"
PACKAGE="irda-utils"
DESC="IrDA service"
SYSCTL="/sbin/sysctl"
SMCINIT="/usr/sbin/smcinit"
MAX_BAUD_RATE=115200
if [ -f /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
else
log_action_begin_msg () {
echo "$@"
}
log_daemon_msg () {
echo -n "$@... "
}
log_end_msg () {
if [ "$1" -eq 0 ]; then
echo done.
else
echo failed.
fi
}
log_action_end_msg () {
:;
}
fi
test -x $DAEMON || exit 0
test -x $SYSCTL || exit 0
# Handle configuration
if [ -f /etc/default/$PACKAGE ]; then
. /etc/default/$PACKAGE
fi
if [ "$AUTOMATIC" = "true" ] && [ -f /var/run/irdadev ]; then
# We discovered a device on boot. Attempt to bind to it.
ENABLE="true"
read DEVICE JUNK </var/run/irdadev
fi
if [ "$ENABLE" = "false" ]; then
log_action_begin_msg "Skipping $DESC:" "$NAME (not enabled)"
log_action_end_msg 0
exit 0
fi
if [ -z "$DEVICE" ]; then
DEVICE="/dev/ttyS1"
fi
if [ -z "$DONGLE" ]; then
DONGLE=""
else
if [ "$DONGLE" != "none" ]; then
DONGLE="-d $DONGLE"
fi
fi
if [ "$DISCOVERY" = "true" ]; then
DISCOVERY="-s"
else
DISCOVERY=""
fi
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
# Running smcinit is needed in some laptops prior to port use
# You should set this variable in /etc/default/irda-utils
if [ "$USE_SMCINIT" = "yes" ]; then
$SMCINIT
fi
# Needed for some machines in FIR-mode
if [ -n "$SETSERIAL" ]; then
test -x /bin/setserial || exit 0
/bin/setserial $SETSERIAL uart none port 0x0 irq 0
fi
# Needed for pmac_zilog
case $(uname -r) in
2.6.*|3.*)
case "$DEVICE" in
/dev/ttyS*) modprobe irtty-sir 2> /dev/null || true
;;
esac
;;
esac
start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON \
-- $DEVICE $DONGLE $DISCOVERY
log_end_msg $?
sleep 1
if [ -n "$DISCOVERY" ]; then
$SYSCTL -e -q -w net.irda.discovery=1
else
$SYSCTL -e -q -w net.irda.discovery=0
fi
$SYSCTL -e -q -w net.irda.max_baud_rate=$MAX_BAUD_RATE
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
if [ -n "$DISCOVERY" ]; then
$SYSCTL -e -q -w net.irda.discovery=0
fi
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
log_end_msg $?
;;
status)
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
*)
N=/etc/init.d/$PACKAGE
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
|