* Felix Fietkau <[email protected]> [10.11.2013 15:22]:
> We could then also make it check if the /etc/hotplug.d/$SUBSYSTEM
> directory exists before issuing a call to /sbin/hotplug-call.
this sounds good. so in /sbin/hotplug-call there is
everytime the check
[ \! -z "$1" -a -d /etc/hotplug.d/$1 ] && {
...
}
which can be removed afterwards.
also there is a call which looks strange to me:
for script in $(ls /etc/hotplug.d/$1/* 2>&-); do (
[ -f $script ] && . $script
); done
i propose this simpler look:
for FILE in /etc/hotplug.d/$1/*; do (
command . "$FILE"
); done
because we know, that the directory exists
and there is no need to fork "ls" and there
is no need to check for a file if we use 'command'
(a builtin). FILE should be used uppercase, because
this is a global var (just cosmetic).
bye, bastian
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel