Allow including dhcp.sh from other scripts. This is necessary for
protocols which use DHCP in addition to some other control protocol,
e.g., QMI or NCM.

Signed-off-by: Matti Laakso <[email protected]>
---

diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh 
b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index 2e58c19..a1c18c5 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -1,8 +1,10 @@
 #!/bin/sh
 
-. /lib/functions.sh
-. ../netifd-proto.sh
-init_proto "$@"
+[ -n "$INCLUDE_ONLY" ] || {
+       . /lib/functions.sh
+       . ../netifd-proto.sh
+       init_proto "$@"
+}
 
 proto_dhcp_init_config() {
        renew_handler=1
@@ -65,5 +67,7 @@ proto_dhcp_teardown() {
        proto_kill_command "$interface"
 }
 
-add_protocol dhcp
+[ -n "$INCLUDE_ONLY" ] || {
+       add_protocol dhcp
+}
 
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to