Packages/zerotier/files/etc/uci-defaults/80-zt-migration
2024-12-04 10:20:13 +08:00

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