PKG_NAME:=unetd
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/unetd.git
-PKG_SOURCE_DATE:=2025-01-26
-PKG_SOURCE_VERSION:=d13752814651c70d2afc71383612fafc835b631b
-PKG_MIRROR_HASH:=c9de65ae92af2498fcd9d55f9cd2017cb9ac79b03ed5816da21161aa24f226b9
+PKG_SOURCE_DATE:=2025-01-27
+PKG_SOURCE_VERSION:=c293afa01c1328ee8a18fc407948d0529353d7eb
+PKG_MIRROR_HASH:=f91e26cd4d4304170d99a80551691291d7920b9f4e357b0775cdeb138523ccc8
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
proto_config_add_string domain
proto_config_add_boolean dht
proto_config_add_array "tunnels:list(string)"
+ proto_config_add_array "local_network:list(string)"
proto_config_add_array "connect:list(string)"
proto_config_add_array "peer_data:list(string)"
no_device=1
no_proto_task=1
}
+add_array() {
+ local name="$1"
+ local val="$2"
+
+ json_add_array "$name"
+ for c in $val; do
+ json_add_string "" "$c"
+ done
+ json_close_array
+}
+
proto_unet_setup() {
local config="$1"
json_get_values tunnels tunnels
json_get_values connect connect
json_get_values peer_data peer_data
+ json_get_values local_network local_network
device="${device:-$config}"
[ -n "$auth_key" ] && type="${type:-dynamic}"
done
json_close_object
- json_add_array auth_connect
- for c in $connect; do
- json_add_string "" "$c"
- done
- json_close_array
-
- json_add_array peer_data
- for c in $peer_data; do
- json_add_string "" "$c"
- done
- json_close_array
+ add_array local_network "$local_network"
+ add_array auth_connect "$connect"
+ add_array peer_data "$peer_data"
ip link del dev "$device" >/dev/null 2>&1
ip link add dev "$device" type wireguard || {