From 003084c8da093a86ccda7e49210ad83b26d39458 Mon Sep 17 00:00:00 2001 From: K9T33NwthTookThis <127902233+K9T33NwthTookThis@users.noreply.github.com> Date: Sun, 13 Jul 2025 23:26:33 +0100 Subject: [PATCH 1/9] Update info-dumper.sh Allow users to see the actual data being sent (remove # before cat) --- info-dumper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info-dumper.sh b/info-dumper.sh index b436dc1..b97eb03 100755 --- a/info-dumper.sh +++ b/info-dumper.sh @@ -41,7 +41,7 @@ getent passwd | while IFS=: read -r name _ uid _ _ _ _; do awk -v user="$name" '{gsub(user, "[REDACTED]"); print}' /tmp/rpc-dump.txt | tee /tmp/rpc-dump-stripped.txt &>/dev/null done -# cat /tmp/rpc-dump-stripped.txt +cat /tmp/rpc-dump-stripped.txt rm /tmp/rpc-dump.txt printf " From 73b415d729849981c996d12093050189ad94ec50 Mon Sep 17 00:00:00 2001 From: K9T33NwthTookThis <127902233+K9T33NwthTookThis@users.noreply.github.com> Date: Tue, 15 Jul 2025 21:45:32 +0100 Subject: [PATCH 2/9] Update info-dumper.sh Add option to print output --- info-dumper.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/info-dumper.sh b/info-dumper.sh index b97eb03..1d5b84b 100755 --- a/info-dumper.sh +++ b/info-dumper.sh @@ -40,8 +40,10 @@ getent passwd | while IFS=: read -r name _ uid _ _ _ _; do awk -v user="$name" '{gsub(user, "[REDACTED]"); print}' /tmp/rpc-dump.txt | tee /tmp/rpc-dump-stripped.txt &>/dev/null done - -cat /tmp/rpc-dump-stripped.txt +read -p "Print output? [y, N]: " -t 8 output +if [$output == y]; then + cat /tmp/rpc-dump-stripped.txt +fi rm /tmp/rpc-dump.txt printf " From 504fcd06bbe4da2cee8ddf345cab1102ad85c1ae Mon Sep 17 00:00:00 2001 From: K9T33NwthTookThis <127902233+K9T33NwthTookThis@users.noreply.github.com> Date: Tue, 15 Jul 2025 21:50:01 +0100 Subject: [PATCH 3/9] Update info-dumper.sh --- info-dumper.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/info-dumper.sh b/info-dumper.sh index 1d5b84b..5e3a83e 100755 --- a/info-dumper.sh +++ b/info-dumper.sh @@ -40,10 +40,12 @@ getent passwd | while IFS=: read -r name _ uid _ _ _ _; do awk -v user="$name" '{gsub(user, "[REDACTED]"); print}' /tmp/rpc-dump.txt | tee /tmp/rpc-dump-stripped.txt &>/dev/null done + read -p "Print output? [y, N]: " -t 8 output if [$output == y]; then cat /tmp/rpc-dump-stripped.txt fi + rm /tmp/rpc-dump.txt printf " From 414f6d259b4ebff9db6ce32bb3f2e5fd840d7359 Mon Sep 17 00:00:00 2001 From: K9T33NwthTookThis <127902233+K9T33NwthTookThis@users.noreply.github.com> Date: Tue, 15 Jul 2025 22:03:40 +0100 Subject: [PATCH 4/9] Update info-dumper.sh Fix errors --- info-dumper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/info-dumper.sh b/info-dumper.sh index 5e3a83e..dde509f 100755 --- a/info-dumper.sh +++ b/info-dumper.sh @@ -41,8 +41,8 @@ getent passwd | while IFS=: read -r name _ uid _ _ _ _; do awk -v user="$name" '{gsub(user, "[REDACTED]"); print}' /tmp/rpc-dump.txt | tee /tmp/rpc-dump-stripped.txt &>/dev/null done -read -p "Print output? [y, N]: " -t 8 output -if [$output == y]; then +read -p -r "Print output? [y, N]: " -t 8 output +if [[ $output == y ]]; then cat /tmp/rpc-dump-stripped.txt fi From bdb492f5cfbb8325ad82d419b3c9d36416f092ed Mon Sep 17 00:00:00 2001 From: K9T33NwthTookThis <127902233+K9T33NwthTookThis@users.noreply.github.com> Date: Tue, 15 Jul 2025 22:08:03 +0100 Subject: [PATCH 5/9] Update info-dumper.sh --- info-dumper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info-dumper.sh b/info-dumper.sh index dde509f..ebeb95c 100755 --- a/info-dumper.sh +++ b/info-dumper.sh @@ -41,7 +41,7 @@ getent passwd | while IFS=: read -r name _ uid _ _ _ _; do awk -v user="$name" '{gsub(user, "[REDACTED]"); print}' /tmp/rpc-dump.txt | tee /tmp/rpc-dump-stripped.txt &>/dev/null done -read -p -r "Print output? [y, N]: " -t 8 output +read -r -p "Print output? [y, N]: " -t 8 output if [[ $output == y ]]; then cat /tmp/rpc-dump-stripped.txt fi From e21bfdd7a8d76ab3f027a999fea090639482f2f6 Mon Sep 17 00:00:00 2001 From: K9T33NwthTookThis <127902233+K9T33NwthTookThis@users.noreply.github.com> Date: Tue, 15 Jul 2025 22:09:06 +0100 Subject: [PATCH 6/9] Update info-dumper.sh --- info-dumper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info-dumper.sh b/info-dumper.sh index ebeb95c..f41b6fb 100755 --- a/info-dumper.sh +++ b/info-dumper.sh @@ -41,7 +41,7 @@ getent passwd | while IFS=: read -r name _ uid _ _ _ _; do awk -v user="$name" '{gsub(user, "[REDACTED]"); print}' /tmp/rpc-dump.txt | tee /tmp/rpc-dump-stripped.txt &>/dev/null done -read -r -p "Print output? [y, N]: " -t 8 output +read -p "Print output? [y, N]: " -t 8 output if [[ $output == y ]]; then cat /tmp/rpc-dump-stripped.txt fi From b56872ae5087797c3cb4b46c3effd694267c4cb9 Mon Sep 17 00:00:00 2001 From: K9T33NwthTookThis <127902233+K9T33NwthTookThis@users.noreply.github.com> Date: Tue, 15 Jul 2025 22:12:23 +0100 Subject: [PATCH 7/9] Update info-dumper.sh --- info-dumper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info-dumper.sh b/info-dumper.sh index f41b6fb..ebeb95c 100755 --- a/info-dumper.sh +++ b/info-dumper.sh @@ -41,7 +41,7 @@ getent passwd | while IFS=: read -r name _ uid _ _ _ _; do awk -v user="$name" '{gsub(user, "[REDACTED]"); print}' /tmp/rpc-dump.txt | tee /tmp/rpc-dump-stripped.txt &>/dev/null done -read -p "Print output? [y, N]: " -t 8 output +read -r -p "Print output? [y, N]: " -t 8 output if [[ $output == y ]]; then cat /tmp/rpc-dump-stripped.txt fi From e6e521ab31bb51177f4fa02608be1bef94da58c7 Mon Sep 17 00:00:00 2001 From: K9T33NwthTookThis <127902233+K9T33NwthTookThis@users.noreply.github.com> Date: Tue, 15 Jul 2025 22:26:30 +0100 Subject: [PATCH 8/9] Update info-dumper.sh --- info-dumper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info-dumper.sh b/info-dumper.sh index ebeb95c..1268455 100755 --- a/info-dumper.sh +++ b/info-dumper.sh @@ -41,7 +41,7 @@ getent passwd | while IFS=: read -r name _ uid _ _ _ _; do awk -v user="$name" '{gsub(user, "[REDACTED]"); print}' /tmp/rpc-dump.txt | tee /tmp/rpc-dump-stripped.txt &>/dev/null done -read -r -p "Print output? [y, N]: " -t 8 output +read -rp "Print output? [y, N]: " -t 8 output if [[ $output == y ]]; then cat /tmp/rpc-dump-stripped.txt fi From 59d38e0bc4ee181c150ff6933d77c520cc3d5dc3 Mon Sep 17 00:00:00 2001 From: illegitimate-egg Date: Tue, 15 Jul 2025 23:06:36 +0100 Subject: [PATCH 9/9] Fix stream issues --- README.md | 6 ++++- info-dumper.sh | 63 ++++++++------------------------------------------ main.sh | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 55 deletions(-) create mode 100755 main.sh diff --git a/README.md b/README.md index 20b6d7c..ae46828 100644 --- a/README.md +++ b/README.md @@ -9,5 +9,9 @@ The script is also available as a redirect from https://dukesyndicate.org/info-d | Transfer method | Command | |-----------------|-------------------------------------------------------------------| | curl | `curl -sSL https://dukesyndicate.org/info-dumper.sh \| sudo bash` | -| wget | `wget -qO- https://dukesyndicate.org/info-dumper.sh \| sudo bash` | + +Deprecated transfer methods: +| Transfer method | Command | Deprecation reason | +|-----------------|-------------------------------------------------------------------|-----------------------------| +| wget | `wget -qO- https://dukesyndicate.org/info-dumper.sh \| sudo bash` | Program now depends on curl | diff --git a/info-dumper.sh b/info-dumper.sh index 1268455..044bfe1 100755 --- a/info-dumper.sh +++ b/info-dumper.sh @@ -1,58 +1,13 @@ #!/bin/bash -if [[ $EUID -ne 0 ]]; then - printf "This script must be run as root" - exit 1 -fi +### +# This is the Raspberry Pi Community info dumper entry point. The additional file is necessary as another pipe is needed for user input, +# it is easier to have bash use a file pipe than it is to use named pipes. This will also help for future expansion. - illegitimate-egg (2025-07-15) +### -printf "version info:\n" >/tmp/rpc-dump.txt -{ - # pi model/device - uname -a - printf "\n" - cat /proc/version +# Acquire script +curl -sSL https://raw.githubusercontent.com/K9T33NwthTookThis/RPC-info-dumper/refs/heads/main/main.sh > /tmp/rpc-info-dumper.sh +chmod +x /tmp/rpc-info-dumper.sh - printf "\n\n journalctl:\n" - journalctl -n 50 --no-pager - - printf "\n\n dmesg:\n" - dmesg -H | tail -50 - - printf "\n\n storage:\n" - df -h - - printf "\n\n cpu info:\n" - lscpu - - printf "\n\n pci:\n" - lspci - - printf "\n\n uptime:\n" - uptime -} >>/tmp/rpc-dump.txt - -# Remove non system user names on system -getent passwd | while IFS=: read -r name _ uid _ _ _ _; do - # System accounts shouldn't be redacted, as well as some user accounts - if ((uid < 1000)); then - continue - fi - - awk -v user="$name" '{gsub(user, "[REDACTED]"); print}' /tmp/rpc-dump.txt | tee /tmp/rpc-dump-stripped.txt &>/dev/null -done - -read -rp "Print output? [y, N]: " -t 8 output -if [[ $output == y ]]; then - cat /tmp/rpc-dump-stripped.txt -fi - -rm /tmp/rpc-dump.txt - -printf " - __ - _____ _____ _____ ____ _____ _____ __ _____ _ _ _| | -| __ | __| _ | \ | __ | __| | | | | | | | -| -| __| | | | | __ -| __| |__| | | | | |__| -|__|__|_____|__|__|____/ |_____|_____|_____|_____|_____|__|\n" -printf "\nSend this link to the person who asked you to run this:\n" -curl -F'file=@/tmp/rpc-dump-stripped.txt' -A "raspberry-pi-community info reporter, " https://0x0.st +# Launch that thing +sudo bash /tmp/rpc-info-dumper.sh diff --git a/main.sh b/main.sh new file mode 100755 index 0000000..1268455 --- /dev/null +++ b/main.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +if [[ $EUID -ne 0 ]]; then + printf "This script must be run as root" + exit 1 +fi + +printf "version info:\n" >/tmp/rpc-dump.txt +{ + # pi model/device + uname -a + printf "\n" + cat /proc/version + + printf "\n\n journalctl:\n" + journalctl -n 50 --no-pager + + printf "\n\n dmesg:\n" + dmesg -H | tail -50 + + printf "\n\n storage:\n" + df -h + + printf "\n\n cpu info:\n" + lscpu + + printf "\n\n pci:\n" + lspci + + printf "\n\n uptime:\n" + uptime +} >>/tmp/rpc-dump.txt + +# Remove non system user names on system +getent passwd | while IFS=: read -r name _ uid _ _ _ _; do + # System accounts shouldn't be redacted, as well as some user accounts + if ((uid < 1000)); then + continue + fi + + awk -v user="$name" '{gsub(user, "[REDACTED]"); print}' /tmp/rpc-dump.txt | tee /tmp/rpc-dump-stripped.txt &>/dev/null +done + +read -rp "Print output? [y, N]: " -t 8 output +if [[ $output == y ]]; then + cat /tmp/rpc-dump-stripped.txt +fi + +rm /tmp/rpc-dump.txt + +printf " + __ + _____ _____ _____ ____ _____ _____ __ _____ _ _ _| | +| __ | __| _ | \ | __ | __| | | | | | | | +| -| __| | | | | __ -| __| |__| | | | | |__| +|__|__|_____|__|__|____/ |_____|_____|_____|_____|_____|__|\n" +printf "\nSend this link to the person who asked you to run this:\n" +curl -F'file=@/tmp/rpc-dump-stripped.txt' -A "raspberry-pi-community info reporter, " https://0x0.st