#!/bin/sh
set -x
#  To remove a SCSI device:
#
#      echo "scsi remove-single-device a b c d" > /proc/scsi/scsi
#
#  and similar, to add a SCSI device, do
#
#       echo "scsi add-single-device a b c d" > /proc/scsi/scsi
#
#  where
#
#            a == hostadapter id (first one being 0)
#            b == SCSI channel on hostadapter (first one being 0)
#            c == ID
#            d == LUN (first one being 0)
       echo "scsi remove-single-device 0 0 0 0" > /proc/scsi/scsi
       echo "scsi remove-single-device 0 0 1 0" > /proc/scsi/scsi
       echo "scsi remove-single-device 0 0 2 0" > /proc/scsi/scsi
       echo "scsi remove-single-device 0 0 3 0" > /proc/scsi/scsi
       echo "scsi remove-single-device 0 0 4 0" > /proc/scsi/scsi
       echo "scsi remove-single-device 0 0 5 0" > /proc/scsi/scsi
       echo "scsi remove-single-device 0 0 6 0" > /proc/scsi/scsi
       echo "scsi remove-single-device 1 0 0 0" > /proc/scsi/scsi
       echo "scsi remove-single-device 1 0 1 0" > /proc/scsi/scsi
       echo "scsi remove-single-device 1 0 2 0" > /proc/scsi/scsi
       echo "scsi remove-single-device 1 0 3 0" > /proc/scsi/scsi
       echo "scsi remove-single-device 1 0 4 0" > /proc/scsi/scsi
       echo "scsi remove-single-device 1 0 5 0" > /proc/scsi/scsi
       echo "scsi remove-single-device 1 0 6 0" > /proc/scsi/scsi

       echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi
       echo "scsi add-single-device 0 0 1 0" > /proc/scsi/scsi
       echo "scsi add-single-device 0 0 2 0" > /proc/scsi/scsi
       echo "scsi add-single-device 0 0 3 0" > /proc/scsi/scsi
       echo "scsi add-single-device 0 0 4 0" > /proc/scsi/scsi
       echo "scsi add-single-device 0 0 5 0" > /proc/scsi/scsi
       echo "scsi add-single-device 0 0 6 0" > /proc/scsi/scsi
       echo "scsi add-single-device 1 0 0 0" > /proc/scsi/scsi
       echo "scsi add-single-device 1 0 1 0" > /proc/scsi/scsi
       echo "scsi add-single-device 1 0 2 0" > /proc/scsi/scsi
       echo "scsi add-single-device 1 0 3 0" > /proc/scsi/scsi
       echo "scsi add-single-device 1 0 4 0" > /proc/scsi/scsi
       echo "scsi add-single-device 1 0 5 0" > /proc/scsi/scsi
       echo "scsi add-single-device 1 0 6 0" > /proc/scsi/scsi

#  since generic devices are mapped in the order of their insertion.


