Minor changes

This commit is contained in:
Loïc Guégan 2024-07-04 14:56:18 +02:00
parent 3a3e71450a
commit 33de6a5a9e
2 changed files with 12 additions and 6 deletions

View file

@ -21,10 +21,15 @@ Explore specific entries of a dump:
If `sysdump.sh` is not run as root, these commands will not be executed. If `sysdump.sh` is not run as root, these commands will not be executed.
# Useful entries # Useful entries
Important note: Depending on the system, some entries may not be available.
| Entry | Description |
|-------------|-----------------------------|
| compgen | List all available commands |
| boot_folder | Recursive listing of /boot/ |
| root_folder | Content of / |
| home_folder | Content of $HOME |
| Entry | Description |
|---------|-----------------------------|
| compgen | List all available commands |

View file

@ -24,7 +24,7 @@ dump() {
[ -z "$2" ] && return [ -z "$2" ] && return
entry=$1 entry=$1
shift shift
value=$($@|base64 -w 0) value=$($@ 2>&1|base64 -w 0)
[ "$USE_COMMA" -eq 1 ] && echo "\"${entry}\": \"${value}\"," [ "$USE_COMMA" -eq 1 ] && echo "\"${entry}\": \"${value}\","
[ "$USE_COMMA" -eq 0 ] && echo "\"${entry}\": \"${value}\"" [ "$USE_COMMA" -eq 0 ] && echo "\"${entry}\": \"${value}\""
} }
@ -76,7 +76,7 @@ dump "/etc/sysctl.conf" safecat /etc/sysctl.conf
dump "/etc/apt/sources.list" safecat /etc/apt/sources.list dump "/etc/apt/sources.list" safecat /etc/apt/sources.list
dump "/etc/hosts" safecat /etc/hosts dump "/etc/hosts" safecat /etc/hosts
dump "/etc/bash.bashrc" safecat /etc/bash.bashrc dump "/etc/bash.bashrc" safecat /etc/bash.bashrc
dump "timezone" safecat /etc/timezone dump "/etc/timezone" safecat /etc/timezone
dump "/boot/config-$(uname -r)" safecat /boot/config-$(uname -r) dump "/boot/config-$(uname -r)" safecat /boot/config-$(uname -r)
# safecatroot # safecatroot
dump "/etc/shadow" safecatroot /etc/shadow dump "/etc/shadow" safecatroot /etc/shadow
@ -91,7 +91,8 @@ dump "locale" safecmd locale
dump "systemctl" safecmd systemctl --no-pager dump "systemctl" safecmd systemctl --no-pager
dump "free" safecmd free -h dump "free" safecmd free -h
dump "df" safecmd df -h dump "df" safecmd df -h
dump "boot_folder" safecmd ls -al /boot/ dump "boot_folder" safecmd ls -R /boot/
dump "home_folder" safecmd ls -al ${HOME}
dump "uid" safecmd id -u dump "uid" safecmd id -u
dump "gid" safecmd id -g dump "gid" safecmd id -g
dump "gids" safecmd id -G dump "gids" safecmd id -G