Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 26 additions & 19 deletions raspinfo/raspinfo
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# IP4 d.d.d.d decimal "s/\([0-9]\{1,3\}\.\)\{3,3\}[0-9]\{1,3\}/x.x.x.x/g"
# mac address "s/\([0-9a-fA-F]\{2,2\}\:\)\{5,5\}[0-9a-fA-F]\{2,2\}/m.m.m.m/g"

alias filter="sed -e 's/\([0-9a-fA-F]\{1,4\}:\)\{7,7\}[0-9a-fA-F]\{1,4\}/y.y.y.y.y.y.y.y/g' | sed -e 's/[0-9a-fA-F]\{1,4\}:\(:[0-9a-fA-F]\{1,4\}\)\{1,4\}/y::y.y.y.y/g' | sed -e 's/\([0-9]\{1,3\}\.\)\{3,3\}[0-9]\{1,3\}/x.x.x.x/g' | sed -e 's/\([0-9a-fA-F]\{2,2\}\:\)\{5,5\}[0-9a-fA-F]\{2,2\}/m.m.m.m/g'"

display_info_drm() {
# kmsprint is more useful, but not always installed
Expand Down Expand Up @@ -168,20 +169,6 @@ audio_info() {
}

network_info() {
ifconfig | sed -e "s/\([0-9a-fA-F]\{1,4\}:\)\{7,7\}[0-9a-fA-F]\{1,4\}/y.y.y.y.y.y.y.y/g" | sed -e "s/[0-9a-fA-F]\{1,4\}:\(:[0-9a-fA-F]\{1,4\}\)\{1,4\}/y::y.y.y.y/g" | sed -e "s/\([0-9]\{1,3\}\.\)\{3,3\}[0-9]\{1,3\}/x.x.x.x/g" | sed -e "s/\([0-9a-fA-F]\{2,2\}\:\)\{5,5\}[0-9a-fA-F]\{2,2\}/m.m.m.m/g"
echo
if command -v ethtool > /dev/null; then
ethtool eth0
echo
ethtool --show-eee eth0
echo
ethtool -S eth0
else
echo "ethtool not installed"
fi
}

wifi_info() {
cat /proc/net/wireless 2>/dev/null || echo "/proc/net/wireless not available"
echo
if command -v rfkill >/dev/null; then
Expand All @@ -190,8 +177,28 @@ wifi_info() {
echo "rfkill not installed"
fi
echo

if command -v ethtool >/dev/null; then
ethtool -i wlan0
# Using sysfs to identify physical interfaces
for iface in /sys/class/net/*; do
iface_name=$(basename "$iface")
# Check if device directory exists (indicates physical interface)
Comment thread
macmpi marked this conversation as resolved.
if [ -d "$iface/device" ]; then
ifconfig $iface_name | filter
if [ -d "$iface/phy80211" ]; then
ethtool -i $iface_name
else
sudo ethtool $iface_name
echo
ethtool --show-eee $iface_name
echo
ethtool -S $iface_name
fi
echo
fi
Comment thread
macmpi marked this conversation as resolved.
done
else
echo "ethtool not installed"
fi
}

Expand Down Expand Up @@ -246,6 +253,7 @@ vcgencmd mem_reloc_stats
echo
echo "Filesystem information"
echo "----------------------"
echo

df
echo
Expand All @@ -254,6 +262,7 @@ cat /proc/swaps
echo
echo "Package version information"
echo "---------------------------"
echo

apt-cache policy raspberrypi-ui-mods | head -2
apt-cache policy raspberrypi-sys-mods | head -2
Expand All @@ -269,8 +278,6 @@ echo

network_info
echo
wifi_info
echo

echo "USB Information"
echo "---------------"
Expand Down Expand Up @@ -305,6 +312,7 @@ vcgencmd get_config str
echo
echo "cmdline.txt"
echo "-----------"
echo

cat /proc/cmdline

Expand Down Expand Up @@ -339,8 +347,7 @@ echo "dmesg log"
echo "---------"
echo

sudo dmesg | sed -e "s/\([0-9a-fA-F]\{1,4\}:\)\{7,7\}[0-9a-fA-F]\{1,4\}/y.y.y.y.y.y.y.y/g" | sed -e "s/[0-9a-fA-F]\{1,4\}:\(:[0-9a-fA-F]\{1,4\}\)\{1,4\}/y::y.y.y.y/g" | sed -e "s/\([0-9a-fA-F]\{2,2\}\:\)\{5,5\}[0-9a-fA-F]\{2,2\}/m.m.m.m/g"

sudo dmesg | filter

if grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]1[13457][0-9a-fA-F]$" /proc/cpuinfo
then
Expand Down
Loading