summaryrefslogtreecommitdiff
path: root/templates/show/raid
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2008-10-29 16:32:30 -0700
committerBob Gilligan <gilligan@vyatta.com>2008-10-29 16:32:30 -0700
commit78e41fb517a63c4a9cc225975e4714f84918149d (patch)
tree5a490f5f62b8be03c18b230e50bb1f7c327d86a5 /templates/show/raid
parent5304fabe0b0eb212936ca1f47e4cf98d73fd6b81 (diff)
downloadvyatta-op-78e41fb517a63c4a9cc225975e4714f84918149d.tar.gz
vyatta-op-78e41fb517a63c4a9cc225975e4714f84918149d.zip
Bugfix: 3841: Allow admin level users to run the RAID op mode commands.
Diffstat (limited to 'templates/show/raid')
-rw-r--r--templates/show/raid/node.tag/node.def9
1 files changed, 8 insertions, 1 deletions
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