openconnect: fix inclusion of netifd proto scripts
authorRui Salvaterra <rsalvaterra@gmail.com>
Tue, 24 May 2022 16:13:04 +0000 (17:13 +0100)
committerRosen Penev <rosenp@gmail.com>
Wed, 1 Jun 2022 20:54:13 +0000 (13:54 -0700)
This is the preferred way, according to the wiki.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
net/openconnect/files/openconnect.sh

index 1de3a8b25ecc2d0526b855f1c896556c65b432d9..58e44be931489e9336f5d90f80f958a389df8505 100755 (executable)
@@ -1,7 +1,10 @@
 #!/bin/sh
-. /lib/functions.sh
-. ../netifd-proto.sh
-init_proto "$@"
+
+[ -n "$INCLUDE_ONLY" ] || {
+       . /lib/functions.sh
+       . ../netifd-proto.sh
+       init_proto "$@"
+}
 
 append_args() {
        while [ $# -gt 0 ]; do
@@ -149,4 +152,6 @@ proto_openconnect_teardown() {
        proto_kill_command "$config" 2
 }
 
-add_protocol openconnect
+[ -n "$INCLUDE_ONLY" ] || {
+       add_protocol openconnect
+}