summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@uffda.(none)>2007-11-02 12:23:55 -0700
committerStig Thormodsrud <stig@uffda.(none)>2007-11-02 12:23:55 -0700
commitec5006f51ff0abc03026f8e6f3d311c705b202f7 (patch)
tree0617b94fb2798b3b7fad5dfdcf050ff578f5b9aa
parent81dc1cbd4626827284d0a8952a5365edac654ddb (diff)
downloadvyatta-op-ec5006f51ff0abc03026f8e6f3d311c705b202f7.tar.gz
vyatta-op-ec5006f51ff0abc03026f8e6f3d311c705b202f7.zip
- Add "show log"
- Fix "show ntp" for non-root user.
-rw-r--r--templates/show/log/directory/node.def2
-rw-r--r--templates/show/log/file/node.def2
-rw-r--r--templates/show/log/file/node.tag/node.def5
-rw-r--r--templates/show/log/node.def2
-rw-r--r--templates/show/ntp/node.def2
-rw-r--r--templates/show/ntp/node.tag/node.def2
6 files changed, 13 insertions, 2 deletions
diff --git a/templates/show/log/directory/node.def b/templates/show/log/directory/node.def
new file mode 100644
index 0000000..481d36d
--- /dev/null
+++ b/templates/show/log/directory/node.def
@@ -0,0 +1,2 @@
+help: Show listing of user-defined log files
+run: ls /var/log/user/
diff --git a/templates/show/log/file/node.def b/templates/show/log/file/node.def
new file mode 100644
index 0000000..4e91f06
--- /dev/null
+++ b/templates/show/log/file/node.def
@@ -0,0 +1,2 @@
+help: Show contents of user-defined log file
+
diff --git a/templates/show/log/file/node.tag/node.def b/templates/show/log/file/node.tag/node.def
new file mode 100644
index 0000000..236515c
--- /dev/null
+++ b/templates/show/log/file/node.tag/node.def
@@ -0,0 +1,5 @@
+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;
diff --git a/templates/show/log/node.def b/templates/show/log/node.def
new file mode 100644
index 0000000..820672e
--- /dev/null
+++ b/templates/show/log/node.def
@@ -0,0 +1,2 @@
+help: Show contents of master log file
+run: sudo sh -c "cat `ls /var/log/message* | sort -r` " \ No newline at end of file
diff --git a/templates/show/ntp/node.def b/templates/show/ntp/node.def
index 2a53d0a..c56d291 100644
--- a/templates/show/ntp/node.def
+++ b/templates/show/ntp/node.def
@@ -1,2 +1,2 @@
help: Show date and time of network server [default: ntp.vyatta.com]
-run: ntpdate -q ntp.vyatta.com
+run: /usr/sbin/ntpdate -q ntp.vyatta.com
diff --git a/templates/show/ntp/node.tag/node.def b/templates/show/ntp/node.tag/node.def
index aa0dfaa..38828a8 100644
--- a/templates/show/ntp/node.tag/node.def
+++ b/templates/show/ntp/node.tag/node.def
@@ -1,3 +1,3 @@
help: Show date and time of given NTP server
allowed: sed 's/#.*//; s/^[^ \t]*[ \t]//; /^$/d' ${HOSTFILE:-/dev/null}
-run: ntpdate -q ${3:-ntp.vyatta.com}
+run: /usr/sbin/ntpdate -q ${3:-ntp.vyatta.com}