summaryrefslogtreecommitdiff
path: root/templates/show
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-04-23 12:48:18 -0700
committerJohn Southworth <john.southworth@vyatta.com>2011-04-23 12:48:18 -0700
commit1d0cd8922bab1d8d53b886b8287baeb22979d087 (patch)
treef01a00eb1e79279a06395a9d718508015da3a18b /templates/show
parent17e28be540ef15c57d11b07cb8b9ad1365163078 (diff)
downloadvyatta-op-1d0cd8922bab1d8d53b886b8287baeb22979d087.tar.gz
vyatta-op-1d0cd8922bab1d8d53b886b8287baeb22979d087.zip
Initial addition of image op mode tools
Diffstat (limited to 'templates/show')
-rw-r--r--templates/show/files/node.def2
-rw-r--r--templates/show/files/node.tag/node.def5
-rw-r--r--templates/show/log/image/node.def1
-rw-r--r--templates/show/log/image/node.tag/all/node.def5
-rw-r--r--templates/show/log/image/node.tag/authorization/node.def4
-rw-r--r--templates/show/log/image/node.tag/directory/node.def4
-rw-r--r--templates/show/log/image/node.tag/file/node.def2
-rw-r--r--templates/show/log/image/node.tag/file/node.tag/node.def7
-rw-r--r--templates/show/log/image/node.tag/node.def11
9 files changed, 38 insertions, 3 deletions
diff --git a/templates/show/files/node.def b/templates/show/files/node.def
index 7f9efd0..a6c408d 100644
--- a/templates/show/files/node.def
+++ b/templates/show/files/node.def
@@ -1 +1 @@
-help: Show file information
+help: Show files for a particular image
diff --git a/templates/show/files/node.tag/node.def b/templates/show/files/node.tag/node.def
index 0448ad4..7e205da 100644
--- a/templates/show/files/node.tag/node.def
+++ b/templates/show/files/node.tag/node.def
@@ -1,3 +1,4 @@
help: Show files in the specified directory
-allowed: echo -n '<pathname>'
-run: ls -lh "$3"
+comptype: imagefiles
+allowed: echo -n "<imagefiles>"
+run: sudo ${vyatta_sbindir}/vyatta-image-tools.pl --show=$3
diff --git a/templates/show/log/image/node.def b/templates/show/log/image/node.def
new file mode 100644
index 0000000..60b0ab3
--- /dev/null
+++ b/templates/show/log/image/node.def
@@ -0,0 +1 @@
+help: Show logs from an image
diff --git a/templates/show/log/image/node.tag/all/node.def b/templates/show/log/image/node.tag/all/node.def
new file mode 100644
index 0000000..eb3c87c
--- /dev/null
+++ b/templates/show/log/image/node.tag/all/node.def
@@ -0,0 +1,5 @@
+help: Show contents of all master log files for image
+run: eval $(lesspipe)
+ less $_vyatta_less_options \
+ --prompt=".log?m, file %i of %m., page %dt of %D" \
+ -- `printf "%s\n" /live/image/boot/$4/live-rw/var/log/messages* | sort -nr`
diff --git a/templates/show/log/image/node.tag/authorization/node.def b/templates/show/log/image/node.tag/authorization/node.def
new file mode 100644
index 0000000..aec45cc
--- /dev/null
+++ b/templates/show/log/image/node.tag/authorization/node.def
@@ -0,0 +1,4 @@
+help: Show listing of authorization attempts for image
+run: less $_vyatta_less_options \
+ --prompt=".log, page %dt of %D" \
+ -- /live/image/boot/$4/live-rw/var/log/auth.log
diff --git a/templates/show/log/image/node.tag/directory/node.def b/templates/show/log/image/node.tag/directory/node.def
new file mode 100644
index 0000000..d9cb9cb
--- /dev/null
+++ b/templates/show/log/image/node.tag/directory/node.def
@@ -0,0 +1,4 @@
+help: Show listing of user-defined log files for image
+run: if [ -d /live/image/boot/$4/live-rw/var/log/user ]
+ then ls /live/image/boot/$4/live-rw/var/log/user
+ fi
diff --git a/templates/show/log/image/node.tag/file/node.def b/templates/show/log/image/node.tag/file/node.def
new file mode 100644
index 0000000..cad207b
--- /dev/null
+++ b/templates/show/log/image/node.tag/file/node.def
@@ -0,0 +1,2 @@
+help: Show contents of user-defined log file for image
+
diff --git a/templates/show/log/image/node.tag/file/node.tag/node.def b/templates/show/log/image/node.tag/file/node.tag/node.def
new file mode 100644
index 0000000..41c170d
--- /dev/null
+++ b/templates/show/log/image/node.tag/file/node.tag/node.def
@@ -0,0 +1,7 @@
+help: Show contents of specified user-defined log file for image
+allowed: local -a array ;
+ array=( /live/image/boot/$4/live-rw/var/log/user/* ) ;
+ [ ${#array[@]} -gt 0 ] && echo -n ${array[@]##*/} || echo -n none
+run: less $_vyatta_less_options \
+ --prompt=".$4 log, page %dt of %D" \
+ -- /live/image/boot/$4/live-rw/var/log/user/$5
diff --git a/templates/show/log/image/node.tag/node.def b/templates/show/log/image/node.tag/node.def
new file mode 100644
index 0000000..daeb44e
--- /dev/null
+++ b/templates/show/log/image/node.tag/node.def
@@ -0,0 +1,11 @@
+help: Show contents of master log file for image
+allowed: reply=( $(compgen -f /live/image/boot/ | grep -v grub) )
+ for i in `seq 0 $[${#reply[@]}-1]`; do
+ file=${reply[$i]}
+ reply[$i]=${file/#\/live\/image\/boot\//}
+ done
+ echo "${reply[*]}"
+
+run: less $_vyatta_less_options \
+ --prompt=".log, page %dt of %D" \
+ -- /live/image/boot/$4/live-rw/var/log/messages