diff --git a/net/openconnect/Makefile b/net/openconnect/Makefile index f3bb6b6733..ff046a16f9 100644 --- a/net/openconnect/Makefile +++ b/net/openconnect/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openconnect PKG_VERSION:=9.12 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.infradead.org/openconnect/download diff --git a/net/openconnect/files/openconnect.sh b/net/openconnect/files/openconnect.sh index d318b97e0d..707c770e74 100755 --- a/net/openconnect/files/openconnect.sh +++ b/net/openconnect/files/openconnect.sh @@ -46,6 +46,7 @@ proto_openconnect_add_form_entry() { proto_openconnect_setup() { local config="$1" + local tmpfile="/tmp/openconnect-server.$$.tmp" json_get_vars \ authgroup \ @@ -76,11 +77,21 @@ proto_openconnect_setup() { logger -t openconnect "initializing..." [ -n "$interface" ] && { + local trials=5 + logger -t "openconnect" "adding host dependency for $server at $config" - for ip in $(resolveip -t 10 "$server"); do - logger -t "openconnect" "adding host dependency for $ip at $config" - proto_add_host_dependency "$config" "$ip" "$interface" + while resolveip -t 10 "$server" > "$tmpfile" && [ "$trials" -gt 0 ]; do + sleep 5 + trials=$((trials - 1)) done + + if [ -s "$tmpfile" ]; then + for ip in $(cat "$tmpfile"); do + logger -t "openconnect" "adding host dependency for $ip at $config" + proto_add_host_dependency "$config" "$ip" "$interface" + done + fi + rm -f "$tmpfile" } [ -n "$port" ] && port=":$port"