gre: use alternative way to check if kernel support is enabled
[openwrt/openwrt.git] / package / network / config / gre / files / gre.sh
index eb3df5b48c874c7e14b32bd53bb27a8ff0854684..b57d5d4cdb3434467184aa08da77e6d0cdf3637c 100755 (executable)
@@ -291,8 +291,6 @@ proto_grev6tap_init_config() {
 }
 
 [ -n "$INCLUDE_ONLY" ] || {
-       [ -f /lib/modules/$(uname -r)/gre.ko ] && add_protocol gre
-       [ -f /lib/modules/$(uname -r)/gre.ko ] && add_protocol gretap
-       [ -f /lib/modules/$(uname -r)/ip6_gre.ko ] && add_protocol grev6
-       [ -f /lib/modules/$(uname -r)/ip6_gre.ko ] && add_protocol grev6tap
+       [ -d /sys/module/ip_gre ] && { add_protocol gre; add_protocol gretap; }
+       [ -d /sys/module/ip6_gre ] && { add_protocol grev6; add_protocol grev6tap; }
 }