aboutsummaryrefslogtreecommitdiff
path: root/scripts/scsi-enable-target-scan.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/scsi-enable-target-scan.sh')
-rwxr-xr-xscripts/scsi-enable-target-scan.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/scsi-enable-target-scan.sh b/scripts/scsi-enable-target-scan.sh
new file mode 100755
index 00000000..63bb9afb
--- /dev/null
+++ b/scripts/scsi-enable-target-scan.sh
@@ -0,0 +1,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