Add exclusion for system/'root' accounts from the filtering

This commit is contained in:
illegitimate-egg 2025-06-28 13:56:45 +01:00
parent 2ec87df8d9
commit 4cead9f433

7
info-dumper.sh Normal file → Executable file
View File

@ -28,8 +28,13 @@ uptime >> /tmp/rpc-dump.txt
# Remove all user names on system
getent passwd | while IFS=: read -r name password uid gid gecos home shell; do
# System accounts shouldn't be redacted, as well as some user accounts
if (( $uid < 1000 )); then
continue
fi
cat /tmp/rpc-dump.txt | awk -v user="$name" '{gsub(user, "[REDACTED]"); print}' | tee /tmp/rpc-dump.txt &>/dev/null
done
cat /tmp/rpc-dump.txt
curl -F'file=@/tmp/rpc-dump.txt' -A "raspberry-pi-community info reporter, <cameron@humaneyestudio.co.uk>" https://0x0.st
curl -F'file=@/tmp/rpc-dump.txt' -A "raspberry-pi-community info reporter, <cameron@humaneyestudio.co.uk>" https://0x0.st