summaryrefslogtreecommitdiffstats
path: root/PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-list.sh.svn-base
diff options
context:
space:
mode:
Diffstat (limited to 'PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-list.sh.svn-base')
-rw-r--r--PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-list.sh.svn-base35
1 files changed, 35 insertions, 0 deletions
diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-list.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-list.sh.svn-base
new file mode 100644
index 0000000..4a17133
--- /dev/null
+++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-list.sh.svn-base
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# Create our device listing
+SYSDISK=$(sysctl -n kern.disks)
+
+# Now loop through these devices, and list the disk drives
+for i in ${SYSDISK}
+do
+
+ # Get the current device
+ DEV="${i}"
+
+ # Make sure we don't find any cd devices
+ case "${DEV}" in
+ acd[0-9]*|cd[0-9]*|scd[0-9]*) continue ;;
+ esac
+
+ # Check the dmesg output for some more info about this device
+ NEWLINE=$(dmesg | sed -n "s/^$DEV: .*<\(.*\)>.*$/ <\1>/p" | head -n 1)
+ if [ -z "$NEWLINE" ]; then
+ NEWLINE=" <Unknown Device>"
+ fi
+
+ # Save the disk list
+ if [ ! -z "$DLIST" ]
+ then
+ DLIST="\n${DLIST}"
+ fi
+
+ DLIST="${DEV}:${NEWLINE}${DLIST}"
+
+done
+
+# Echo out the found line
+echo -e "$DLIST" | sort
OpenPOWER on IntegriCloud