mirror of
https://github.com/openwrt/packages.git
synced 2025-07-16 19:54:47 +00:00
Split configuration in global and per-network sections. This change breaks existing configurations. The following per-network settings are available: * allow_managed * allow_global * allow_default * allow_dns See https://docs.zerotier.com/config/#network-specific-configuration Signed-off-by: Óscar García Amor <contact@ogarcia.me> Reviewed-by: Moritz Warning <moritzwarning@web.de>
20 lines
500 B
Plaintext
20 lines
500 B
Plaintext
# Convert the join list into networks
|
|
nets=$(uci -q get zerotier.@zerotier[0].join)
|
|
|
|
if [ -n "$nets" ]; then
|
|
for net in ${nets}; do
|
|
sid=$(uci add zerotier network)
|
|
uci set zerotier.${sid}.id=${net}
|
|
done
|
|
uci delete zerotier.@zerotier[0].join
|
|
|
|
# Rename local conf (only if defined)
|
|
uci -q rename zerotier.@zerotier[0].local_conf='local_conf_path' || true
|
|
|
|
# Rename configuration to global
|
|
uci rename zerotier.@zerotier[0]='global'
|
|
|
|
# Commit all changes
|
|
uci commit zerotier
|
|
fi
|