diff options
author | Tom Grennan <tgrennan@vyatta.com> | 2007-11-30 17:55:48 -0800 |
---|---|---|
committer | Tom Grennan <tgrennan@vyatta.com> | 2007-11-30 17:55:48 -0800 |
commit | 6f36e1824194fc32f9de9e0531248669dcab0a89 (patch) | |
tree | 136d5434f579aac18e29123eaa2ab53486a8e605 /templates/show | |
parent | edea63c7befc63550fdae6b9e0d1df3e4e0f5556 (diff) | |
download | vyatta-op-6f36e1824194fc32f9de9e0531248669dcab0a89.tar.gz vyatta-op-6f36e1824194fc32f9de9e0531248669dcab0a89.zip |
fix "show log (user) directory|file
Diffstat (limited to 'templates/show')
-rw-r--r-- | templates/show/log/directory/node.def | 2 | ||||
-rw-r--r-- | templates/show/log/file/node.tag/node.def | 6 |
2 files changed, 6 insertions, 2 deletions
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 |