summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTom Grennan <tgrennan@vyatta.com>2007-11-30 18:07:53 -0800
committerTom Grennan <tgrennan@vyatta.com>2007-11-30 18:07:53 -0800
commitf6178a5b8fadae89dfe2630bc27ed8b16f51f7fe (patch)
tree69219b37143972d7a356c938bb3d1433ef85dad7 /scripts
parent6f36e1824194fc32f9de9e0531248669dcab0a89 (diff)
downloadvyatta-op-f6178a5b8fadae89dfe2630bc27ed8b16f51f7fe.tar.gz
vyatta-op-f6178a5b8fadae89dfe2630bc27ed8b16f51f7fe.zip
fix "show system [boot|kernel]-messages"
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-show-dmesg-all9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/vyatta-show-dmesg-all b/scripts/vyatta-show-dmesg-all
new file mode 100755
index 0000000..d511ea0
--- /dev/null
+++ b/scripts/vyatta-show-dmesg-all
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+shopt -s extglob nullglob
+
+declare -a zipped_files=($( printf "%s\n" /var/log/dmesg*.gz | sort -r ))
+declare -a plain_files=($( printf "%s\n" /var/log/dmesg!(*.gz) | sort -r ))
+
+[ ${#zipped_files[@]} -gt 0 ] && gunzip --stdout ${zipped_files[@]}
+[ ${#plain_files[@]} -gt 0 ] && cat ${plain_files[@]}