Improve script
This commit is contained in:
parent
deb082da5c
commit
04cd4621bf
2 changed files with 14 additions and 0 deletions
|
@ -14,3 +14,8 @@ Explore a dump (require `jq`):
|
|||
|
||||
Explore specific entries of a dump:
|
||||
> ./sysdump.sh dump.json uname timezone
|
||||
|
||||
# Notes
|
||||
- To get available entries see into `sysdump.sh`
|
||||
- Some commands require root permissions.
|
||||
If `sysdump.sh` is not run as root, these commands will not be executed.
|
||||
|
|
|
@ -12,6 +12,10 @@ safecmd() {
|
|||
command -v "$1" >/dev/null 2>&1 && $@
|
||||
}
|
||||
|
||||
safecmdroot() {
|
||||
[ $(id -u) -eq 0 ] && safecmd $@
|
||||
}
|
||||
|
||||
dump() {
|
||||
[ -z "$2" ] && return
|
||||
entry=$1
|
||||
|
@ -60,6 +64,7 @@ dump "gid" safecmd id -g
|
|||
dump "gids" safecmd id -G
|
||||
dump "ipaddr" safecmd ip addr
|
||||
dump "/etc/nftables.conf" safecat /etc/nftables.conf
|
||||
dump "/etc/group" safecat /etc/group
|
||||
dump "/proc/cpuinfo" safecat /proc/cpuinfo
|
||||
dump "/etc/os-release" safecat /etc/os-release
|
||||
dump "/proc/zoneinfo" safecat /proc/zoneinfo
|
||||
|
@ -76,6 +81,10 @@ dump "lsmod" safecmd lsmod
|
|||
dump "lspci" safecmd lspci
|
||||
dump "lsirq" safecmd lsirq
|
||||
dump "lsfd" safecmd lsfd
|
||||
dump "dmidecode" safecmdroot dmidecode -t system
|
||||
dump "fdisk" safecmdroot fdisk -l
|
||||
dump "env" safecmd env
|
||||
dump "top" safecmd top -b -n 1
|
||||
dump "locale" safecmd locale
|
||||
dump "timezone" safecat /etc/timezone
|
||||
dump "systemctl" safecmd systemctl --no-pager
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue