5
0
mirror of git://git.proxmox.com/git/pve-network.git synced 2025-01-26 14:03:52 +03:00

sdn: add write_frr_config

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2019-08-29 12:32:53 +02:00 committed by Thomas Lamprecht
parent 5bda8607a4
commit ecdd8c12c2
2 changed files with 18 additions and 0 deletions

View File

@ -259,6 +259,19 @@ sub write_etc_network_config {
$writefh->close();
}
sub write_frr_config {
my ($rawconfig) = @_;
return if !$rawconfig;
return if !-d "/etc/frr";
my $frr_config_file = "/etc/frr/frr.conf";
my $writefh = IO::File->new($frr_config_file,">");
print $writefh $rawconfig;
$writefh->close();
}
sub status {

View File

@ -6,10 +6,15 @@ use PVE::Cluster qw(cfs_read_file);
use PVE::Network::SDN;
my $network_config = PVE::Network::SDN::generate_etc_network_config();
PVE::Network::SDN::write_etc_network_config($network_config);
print "/etc/network/interfaces\n";
print $network_config;
print "\n";
my $frr_config = PVE::Network::SDN::generate_frr_config();
PVE::Network::SDN::write_frr_config($frr_config);
print "/etc/frr/frr.conf\n";
print $frr_config;