summaryrefslogtreecommitdiff
path: root/scripts/vyatta-show-dmesg-all
blob: d511ea0066d50264e3531e37bed2727bf001dd36 (plain)
1
2
3
4
5
6
7
8
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[@]}