tty noisy from /etc/hotplug.d/net/10-ar922x-led-fix
Username: Hugo Almeida
Origin: https://bugs.openwrt.org/index.php?do=details&task_id=2078
Hi,
I think it is just a coding style issue,
but makes tty output noisy when procd debug level selected (3 or 4 for me).
noise examples:
cat: can't open '/sys/devices/virtual/ieee80211/phy*/name': No such file or directory sh: add: unknown operand
or
cat: can't open '/sys/devices/virtual/ieee80211/phy*/name': No such file or directory sh: remove: unknown operand
times depends on how many hotplug event happened
demo patch below
- phyname=$(cat $phydir/phy*/name)
- phyname=$(cat $phydir/phy*/name 2>/dev/null)
- [ -z $phyname -o $ACTION != "add" ] && exit 0
- [ 0 !=
? -o -z "
phyname" -o "$ACTION" != "add" ] && exit 0
- [ $phyname -a $ACTION = "add" ] && {
- [ ! -z "
phyname" -a "
ACTION" == "add" ] && {