diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-03-11 17:21:08 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-03-11 17:53:56 -0700 |
commit | 1eb09874a18e7523cb4b4b09ed0985a9e859bc81 (patch) | |
tree | d2c00525f8bdd10c69af6739249dd219255647ee | |
parent | afa4740db04c68dd31a999e05fd2ceca84b88c5d (diff) | |
download | vyatta-op-1eb09874a18e7523cb4b4b09ed0985a9e859bc81.tar.gz vyatta-op-1eb09874a18e7523cb4b4b09ed0985a9e859bc81.zip |
Cleanup show disk format
Use awk more effectivedly in finding disk names
Check for block device.
-rw-r--r-- | templates/show/disk/node.tag/format/node.def | 9 |
1 files 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" |