aboutsummaryrefslogtreecommitdiff
path: root/scripts/scsi-enable-target-scan.sh
blob: 63bb9afb79b284a0ec7f01ab552d0af74fe3fe90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

MODPARM=/sys/module/scsi_mod/parameters
if [ -w "$MODPARM/scan" ] ; then
    scan_type=$(cat $MODPARM/scan)
    if [ "$scan_type" = "manual" ] ; then
	echo sync > $MODPARM/scan

	for shost in /sys/class/scsi_host/host* ; do
	    echo '- - -' > ${shost}/scan
	done
    fi
fi