Files
luci-app-nyn/zzz/files/usr/bin/zzz-device-info
2025-09-22 16:32:42 +08:00

30 lines
914 B
Bash

#!/bin/sh
# /usr/bin/zzz-device-info
# Helper script to get device information for zzz configuration
echo "Available network devices:"
echo "=========================="
if command -v zzz >/dev/null 2>&1; then
zzz -mode info 2>/dev/null | grep -E "(Found|device|hardware_description)" | while read line; do
echo "$line"
done
else
echo "zzz binary not found. Showing available network interfaces:"
for dev in /sys/class/net/*; do
if [ -d "$dev" ]; then
iface=$(basename "$dev")
if [ "$iface" != "lo" ]; then
echo "Device: $iface"
if [ -f "$dev/address" ]; then
echo " MAC: $(cat "$dev/address")"
fi
if [ -f "$dev/operstate" ]; then
echo " State: $(cat "$dev/operstate")"
fi
echo ""
fi
fi
done
fi