Check for modules.d existence before loading modules
authorFlorian Fainelli <florian@openwrt.org>
Thu, 31 May 2007 15:58:43 +0000 (15:58 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Thu, 31 May 2007 15:58:43 +0000 (15:58 +0000)
SVN-Revision: 7423

package/base-files/files/etc/functions.sh

index 86ea82d..f757ffa 100755 (executable)
@@ -141,8 +141,10 @@ config_foreach() {
 }
 
 load_modules() {
-       cd /etc/modules.d
-       sed 's/^[^#]/insmod &/' $* | ash 2>&- || :
+       [ -d /etc/modules.d ] && {
+               cd /etc/modules.d
+               sed 's/^[^#]/insmod &/' $* | ash 2>&- || :
+       }
 }
 
 include() {