Explorar o código

netifd: add missing do_sysctl function

SVN-Revision: 30749
Felix Fietkau %!s(int64=14) %!d(string=hai) anos
pai
achega
4814eb5df9
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      package/netifd/files/lib/network/config.sh

+ 5 - 0
package/netifd/files/lib/network/config.sh

@@ -57,3 +57,8 @@ setup_interface() {
 	ubus call network.interface."$config" add_device "{ \"name\": \"$iface\" }"
 }
 
+do_sysctl() {
+	[ -n "$2" ] && \
+		sysctl -n -e -w "$1=$2" >/dev/null || \
+		sysctl -n -e "$1"
+}