summaryrefslogtreecommitdiff
path: root/templates/show/disk
diff options
context:
space:
mode:
Diffstat (limited to 'templates/show/disk')
-rw-r--r--templates/show/disk/node.def1
-rw-r--r--templates/show/disk/node.tag/format/node.def12
-rw-r--r--templates/show/disk/node.tag/node.def7
3 files changed, 20 insertions, 0 deletions
diff --git a/templates/show/disk/node.def b/templates/show/disk/node.def
new file mode 100644
index 0000000..8572a9f
--- /dev/null
+++ b/templates/show/disk/node.def
@@ -0,0 +1 @@
+help: Show status of disk device
diff --git a/templates/show/disk/node.tag/format/node.def b/templates/show/disk/node.tag/format/node.def
new file mode 100644
index 0000000..e05b4ad
--- /dev/null
+++ b/templates/show/disk/node.tag/format/node.def
@@ -0,0 +1,12 @@
+help: Show disk drive formatting
+
+run:
+ disk_dev=$3
+ valid_disks=`cat /proc/partitions | awk '{ if ($4!="name") { print $4 } }' | egrep -v "[0-9]"`
+ is_a_disk=`echo $valid_disks | grep $disk_dev`
+
+ if [ -z "$is_a_disk" ]; then
+ echo "$disk_dev is not a disk device"
+ else
+ fdisk -l /dev/${disk_dev}
+ fi
diff --git a/templates/show/disk/node.tag/node.def b/templates/show/disk/node.tag/node.def
new file mode 100644
index 0000000..7e4fe05
--- /dev/null
+++ b/templates/show/disk/node.tag/node.def
@@ -0,0 +1,7 @@
+help: Disk device name
+
+allowed:
+ local -a array ;
+ array=`cat /proc/partitions | awk '{ if ($4!="name") { print $4 } }' | egrep -v "[0-9]"`
+ echo -n $array
+