some commands i've tried : uci show network | grep "=device$" = only shows already configured device ls /sys/class/net/ = includes additional device like lo,ip6tnl, etc grep device /etc/config/network = includes additional device lo and doesn't include wireless device like wlan0, etc
the purpose is i'm makig a script to auto-configure the whole system at first boot
my test script (still contains lo which i don't want to touch) :
#!/bin/bash
x() {
local network_devices
for network_interface in $(uci -X show network | grep "=interface$" | awk -F'=' '{print $1}');do
local network_device=$(uci get ${network_interface}.device 2>/dev/null)
if [[ -n ${network_device} ]] && [[ ! ${network_devices[*]} =~ ${network_device} ]];then
network_devices+=${network_device}
echo "${network_device[*]}"
fi
done
}
x
exit 0
i know i can add [[ "${network_device}" != "lo" ]] to the test script, but i'm curious if there's a proper way than this
I see. For this, I'd look into source of that page to see what it's querying. I'd imagine it's a ubus/rpcd call of sorts, I just don't know what would list devices like that.