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 86ea82de678d569f743273afd5510afbd361a385..f757ffaf269ded0aa88987408f853615d737c18c 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() {