Now some command versions are dumped

This commit is contained in:
Loïc Guégan 2024-07-04 15:47:07 +02:00
parent 55fe564b50
commit 9c17a82163
2 changed files with 24 additions and 13 deletions

View file

@ -15,21 +15,24 @@ Explore a dump (require `jq`):
Explore specific entries of a dump:
> ./sysdump.sh dump.json uname timezone
# Useful entries
Important note: Depending on the system, some entries may not be available.
| Entry | Description |
|-----------------------|------------------------------------------------------------------|
| compgen | List all available commands in current shell |
| ping | Check if ping succeed (internet is available) |
| boot_folder | Recursive listing of /boot/ |
| root_folder | Content of / |
| home_folder | Content of $HOME |
| cmd_<command>_version | Get the version of some specific commands (e.g: gcc, python etc) |
# 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.
# Useful entries
Important note: Depending on the system, some entries may not be available.
| Entry | Description |
|-------------|----------------------------------------------|
| compgen | List all available commands in current shell |
| boot_folder | Recursive listing of /boot/ |
| root_folder | Content of / |
| home_folder | Content of $HOME |
- List available entries:
> cat dump.json |grep -o ".*:"
- List available command versions:
> cat dump.json |grep -o "cmd_.*_version"

View file

@ -111,6 +111,14 @@ dump "lsfd" safecmd lsfd
dump "root_folder" safecmd ls -al /
dump "glxinfo" safecmd glxinfo -B
dump "compgen" safecmd compgen -c
dump "openssl" safecmd openssl
dump "ping" safecmd ping -c 2 -W 2 4.2.2.2
for cmd in bash gcc ld python3 cmake make tar zip gzip bzip2 xz cpio wget rsync curl node pip apt cat systemctl gpg R ruby awk grep sshfs
do
dump "cmd_${cmd}_version" safecmd $cmd --version
done
dump "cmd_ssh_version" safecmd sshd -V
dump "cmd_tmux_version" safecmd tmux -V
# safecmdroot
dump "dmidecode" safecmdroot dmidecode
dump "iptables" safecmdroot iptables -L