File: scsi.rc

package info (click to toggle)
hotplug 0.0.20040329-26
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 480 kB
  • ctags: 22
  • sloc: sh: 652; makefile: 183
file content (40 lines) | stat: -rw-r--r-- 726 bytes parent folder | download | duplicates (2)
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
#!/bin/sh -e
#
# scsi.rc	loads the modules for SCSI devices at boot time, if needed
#		it requires a 2.6 kernel
#
# Copyright (C) Canonical Software Ltd. 2004
# Written by Jeff Bailey <jbailey@ubuntu.com>
#

# only 2.6 kernels are supported
[ -d /sys/block/ ] || exit 0

cd /etc/hotplug
. ./hotplug.functions

scsi_boot_events() {
    export ACTION DEVPATH

    [ "$(echo /sys/bus/scsi/devices/*)" = "/sys/bus/scsi/devices/*" ] && return

    ACTION=add
    for device in /sys/bus/scsi/devices/*; do
	DEVPATH=${device#/sys}
	./scsi.agent
    done
}

# See how we were called.
case "$1" in
    start|restart)
	scsi_boot_events
	;;
    stop)
	;;
    status)
	;;
    *)
	echo "Usage: $0 {start|stop|status|restart}"
	exit 1
esac