summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am1
-rwxr-xr-xscripts/vyatta-show-log-all9
-rw-r--r--templates/show/log/all/node.def2
3 files changed, 12 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 4f73305..8374a6d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,6 +11,7 @@ alloweddir = $(datadir)/vyatta-op/functions/allowed
allowed_DATA = functions/allowed/hosts
bin_SCRIPTS = scripts/vyatta-show-interfaces
+bin_SCRIPTS += scripts/vyatta-show-log-all
bin_SCRIPTS += scripts/vyatta-show-version
cpiop = find . ! -regex '\(.*~\|.*\.bak\|.*\.swp\|.*\#.*\#\)' -print0 | \
diff --git a/scripts/vyatta-show-log-all b/scripts/vyatta-show-log-all
new file mode 100755
index 0000000..ceb439f
--- /dev/null
+++ b/scripts/vyatta-show-log-all
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+shopt -s extglob nullglob
+
+declare -a zipped_files=($( printf "%s\n" /var/log/messages*.gz | sort -r ))
+declare -a plain_files=($( printf "%s\n" /var/log/messages!(*.gz) | sort -r ))
+
+gunzip --stdout ${zipped_files[@]}
+cat ${plain_files[@]}
diff --git a/templates/show/log/all/node.def b/templates/show/log/all/node.def
new file mode 100644
index 0000000..87e959b
--- /dev/null
+++ b/templates/show/log/all/node.def
@@ -0,0 +1,2 @@
+help: Show contents of all master log files
+run: ${vyatta_bindir}/vyatta-show-log-all