lede/target/linux/ramips/base-files/sbin/getmac
2024-12-16 11:21:10 +08:00

16 lines
308 B
Bash
Executable File

#!/bin/sh
. /lib/functions.sh
. /lib/functions/system.sh
if [ -e "/dev/mtd0" ]; then
wifi_mac="$(mtd_get_mac_binary factory 0x4)"
elif [ -e "/dev/mmcblk0" ]; then
wifi_mac="$(mmc_get_mac_binary factory 0x4)"
else
echo "Error: unsupported flash."
exit 1
fi
echo "$wifi_mac" | awk '{print toupper($0)}'