chiark / gitweb /
remove completely useless start script
[elogind.git] / test / test.block
1 #! /bin/sh
2 #
3 # test.block - run udev(8) on each block device in /sys/block
4
5 if [ $# = "0" ] ; then
6         echo
7         echo "usage: $0 <action>"
8         echo "where <action> is \"add\" or \"remove\""
9         echo
10         exit 1
11 fi
12
13 SYSFSDIR=/sys           # change this for a nonstand sysfs mount point
14 BIN=../udev             # location of your udev binary
15 export ACTION=$1        # 'add' or 'remove'
16
17 for i in ${SYSFSDIR}/block/*; do
18         # add each drive
19         export DEVPATH=${i#${SYSFSDIR}}
20         $BIN block
21
22         # add each partition, on each device
23         for j in $i/*; do
24                 if [ -f $j/dev ]; then
25                         export DEVPATH=${j#${SYSFSDIR}}
26                         $BIN block
27                 fi
28         done
29 done