020-lff-migrate-mesh-vpn 659 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. uci rename fastd.ffhl_mesh_vpn=mesh_vpn
  3. bind="$(uci -q get fastd.mesh_vpn.bind)"
  4. uci -q delete fastd.mesh_vpn.bind
  5. if [ "$bind" -a "$bind" != '0.0.0.0' ]; then
  6. uci add_list fastd.mesh_vpn.bind="$bind"
  7. fi
  8. method="$(uci -q get fastd.mesh_vpn.method)"
  9. uci -q delete fastd.mesh_vpn.method
  10. if [ "$method" ]; then
  11. uci add_list fastd.mesh_vpn.method="$method"
  12. fi
  13. uci -q batch <<EOF
  14. set fastd.mesh_vpn.interface=mesh-vpn
  15. delete fastd.mesh_vpn.config
  16. add_list fastd.mesh_vpn.config=/lib/freifunk/mesh-vpn/fastd.conf
  17. delete fastd.mesh_vpn.config_peer_dir
  18. add_list fastd.mesh_vpn.config_peer_dir=/etc/fastd/mesh-vpn/peers
  19. commit fastd
  20. EOF