summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-show-log-all4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/vyatta-show-log-all b/scripts/vyatta-show-log-all
index ceb439f..126b7fc 100755
--- a/scripts/vyatta-show-log-all
+++ b/scripts/vyatta-show-log-all
@@ -5,5 +5,5 @@ 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[@]}
+[ ${#zipped_files[@]} -gt 0 ] && gunzip --stdout ${zipped_files[@]}
+[ ${#plain_files[@]} -gt 0 ] && cat ${plain_files[@]}