#!/bin/tcsh
#
#	ini-lun0-down
#
#	vi: set autoindent tabstop=4 shiftwidth=4 :
#
#	bring down just lun 0, not the connection or session
#	to do this, give a cid that will not match that
#	of any existing connection
#
if ( ! -e /proc/scsi/iscsi_initiator ) then
	echo "/proc/scsi/iscsi_initiator does not exist"
	echo "load the initiator module with ini-install"
	exit 1
endif
#
foreach hostno (/proc/scsi/iscsi_initiator/*)
	if ( ! -f $hostno ) continue
	set hostno = $hostno:t
#
iscsi_config down host=$hostno lun=0 cid=255
