summaryrefslogtreecommitdiff
path: root/templates/show
diff options
context:
space:
mode:
Diffstat (limited to 'templates/show')
-rw-r--r--templates/show/disk/node.tag/format/node.def4
-rw-r--r--templates/show/history/node.tag/node.def4
-rw-r--r--templates/show/raid/node.tag/node.def9
3 files changed, 13 insertions, 4 deletions
diff --git a/templates/show/disk/node.tag/format/node.def b/templates/show/disk/node.tag/format/node.def
index e05b4ad..e5829ca 100644
--- a/templates/show/disk/node.tag/format/node.def
+++ b/templates/show/disk/node.tag/format/node.def
@@ -7,6 +7,8 @@ run:
if [ -z "$is_a_disk" ]; then
echo "$disk_dev is not a disk device"
+ elif [ ! -r /dev/${disk_dev} ]; then
+ echo "Must be admin or root to display disk formating"
else
- fdisk -l /dev/${disk_dev}
+ /sbin/fdisk -l /dev/${disk_dev}
fi
diff --git a/templates/show/history/node.tag/node.def b/templates/show/history/node.tag/node.def
index 2c77a35..a8c3755 100644
--- a/templates/show/history/node.tag/node.def
+++ b/templates/show/history/node.tag/node.def
@@ -1,3 +1,3 @@
-help: Display last commands in history
+help: Display last N commands in history
allowed: echo -n '<NUMBER>'
-run: HISTTIMEFORMAT='%FT%T%z ' history
+run: HISTTIMEFORMAT='%FT%T%z ' history $3
diff --git a/templates/show/raid/node.tag/node.def b/templates/show/raid/node.tag/node.def
index bc83a73..4f9928d 100644
--- a/templates/show/raid/node.tag/node.def
+++ b/templates/show/raid/node.tag/node.def
@@ -12,5 +12,12 @@ run:
if [ -z $valid_set ]; then
echo "$raid_set_name is not a RAID set"
else
- mdadm --detail /dev/${raid_set_name}
+ if [ -r /dev/${raid_set_name} ]; then
+ # This should work without sudo because we have read
+ # access to the dev, but for some reason mdadm must be
+ # run as root in order to succeed.
+ sudo /sbin/mdadm --detail /dev/${raid_set_name}
+ else
+ echo "Must be administrator or root to display RAID status"
+ fi
fi \ No newline at end of file