ar71xx: mute script error in ar922x-led-fix script
authorRosy Song <rosysong@rosinson.com>
Tue, 16 Apr 2019 01:05:14 +0000 (09:05 +0800)
committerPetr Štetiar <ynezz@true.cz>
Sun, 5 May 2019 19:11:01 +0000 (21:11 +0200)
This commit fixes following script error in syslog:

 cat: can't open '/sys/devices/platform/ehci-platform/usb1/1-1/1-1.2/1-1.2:1.4/ieee80211/phy*/name': No such file or directory
 sh: add: unknown operand
 sh: add: unknown operand

Signed-off-by: Rosy Song <rosysong@rosinson.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
[commit subject and message tweaks]

target/linux/ar71xx/base-files/etc/hotplug.d/net/10-ar922x-led-fix

index c41d4b08f64c3c20ce376b8045b9bee82f91c50d..bd1abb9681befe13e281ed7614202c2293926301 100644 (file)
@@ -12,6 +12,9 @@
 devdir=$(dirname $DEVPATH)
 devdir=$(dirname $devdir)
 phydir=/sys$devdir/ieee80211
+
+[ -d $phydir ] || exit 0
+
 phyname=$(cat $phydir/phy*/name)
 
 [ -z $phyname -o $ACTION != "add" ] && exit 0