From 6f36e1824194fc32f9de9e0531248669dcab0a89 Mon Sep 17 00:00:00 2001 From: Tom Grennan Date: Fri, 30 Nov 2007 17:55:48 -0800 Subject: fix "show log (user) directory|file --- templates/show/log/directory/node.def | 2 +- templates/show/log/file/node.tag/node.def | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/show/log/directory/node.def b/templates/show/log/directory/node.def index 481d36d..6347082 100644 --- a/templates/show/log/directory/node.def +++ b/templates/show/log/directory/node.def @@ -1,2 +1,2 @@ help: Show listing of user-defined log files -run: ls /var/log/user/ +run: test -d /var/log/user && ls /var/log/user/ diff --git a/templates/show/log/file/node.tag/node.def b/templates/show/log/file/node.tag/node.def index 236515c..443458a 100644 --- a/templates/show/log/file/node.tag/node.def +++ b/templates/show/log/file/node.tag/node.def @@ -2,4 +2,8 @@ help: Show contents of user-defined log file allowed: local -a array ; array=( /var/log/user/* ) ; echo -n ${array[@]##*/} -run: if [ -f /var/log/user/$4 ]; then sudo cat /var/log/user/$4; else echo "no such file"; fi; +run: if [ -f /var/log/user/$4 ]; then + cat /var/log/user/$4; + else + echo "no such file"; + fi -- cgit v1.2.3