Skip to content
Open
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
35 changes: 21 additions & 14 deletions raspinfo/raspinfo
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,7 @@ 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 +179,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
echo "$iface_name interface:"
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 @@ -269,8 +278,6 @@ echo

network_info
echo
wifi_info
echo

echo "USB Information"
echo "---------------"
Expand Down
Loading