From 1eb09874a18e7523cb4b4b09ed0985a9e859bc81 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 11 Mar 2009 17:21:08 -0700 Subject: Cleanup show disk format Use awk more effectivedly in finding disk names Check for block device. --- templates/show/disk/node.tag/format/node.def | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/show/disk/node.tag/format/node.def b/templates/show/disk/node.tag/format/node.def index 4b09369..ef65197 100644 --- a/templates/show/disk/node.tag/format/node.def +++ b/templates/show/disk/node.tag/format/node.def @@ -1,6 +1,7 @@ help: Show disk drive formatting -run: dev=/dev/$3 - if [ ! -b $dev ] - then echo "$3 is not a disk device"; exit 1 +run: disk_dev="/dev/$3" + if [ ! -b "$disk_dev" ] + then echo "$3 is not a disk device" + exit 1 fi - /sbin/fdisk -l /dev/${disk_dev} + /sbin/fdisk -l "$disk_dev" -- cgit v1.2.3