From f0e56caa3ccce6e22cf42c3689a2e85750e8aabc Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 3 Oct 2013 18:41:45 +0200 Subject: [PATCH] gluon-mesh-vpn-fastd: clean up configuration script --- gluon/gluon-mesh-vpn-fastd/fastd.pl | 73 ++++++++++++++++------------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/gluon/gluon-mesh-vpn-fastd/fastd.pl b/gluon/gluon-mesh-vpn-fastd/fastd.pl index dd2f64e..85b24c8 100644 --- a/gluon/gluon-mesh-vpn-fastd/fastd.pl +++ b/gluon/gluon-mesh-vpn-fastd/fastd.pl @@ -3,63 +3,72 @@ my $backbone = $cfg->{backbone}; my $add_methods = ''; for (@{$cfg->{methods}}) { - $add_methods .= "add_list fastd.mesh_vpn.method='$_'\n"; + $add_methods .= "uci add_list fastd.mesh_vpn.method='$_'\n"; } my $set_peer_limit; if ($backbone->{limit}) { - $set_peer_limit = "set fastd.mesh_vpn_backbone.peer_limit='$backbone->{limit}'\n"; + $set_peer_limit = "uci_set fastd mesh_vpn_backbone peer_limit '$backbone->{limit}'\n"; } else { - $set_peer_limit = "delete fastd.mesh_vpn_backbone.peer_limit\n"; + $set_peer_limit = "uci_remove fastd mesh_vpn_backbone peer_limit\n"; } print <{mtu}' + +uci_remove fastd mesh_vpn method $add_methods -delete fastd.mesh_vpn_backbone -set fastd.mesh_vpn_backbone='peer_group' -set fastd.mesh_vpn_backbone.enabled='1' -set fastd.mesh_vpn_backbone.net='mesh_vpn' + +uci_remove fastd mesh_vpn_backbone +uci_add fastd peer_group mesh_vpn_backbone +uci_set fastd mesh_vpn_backbone enabled '1' +uci_set fastd mesh_vpn_backbone net 'mesh_vpn' $set_peer_limit END foreach my $name (sort keys %{$backbone->{peers}}) { my $peer = $backbone->{peers}->{$name}; print <{key}' EOF for (@{$peer->{remotes}}) { - print "add_list fastd.mesh_vpn_backbone_peer_$name.remote='$_'\n"; + print "uci add_list fastd.mesh_vpn_backbone_peer_$name.remote='$_'\n"; } } -print <