@ -1767,6 +1767,7 @@ sub reconfigure_interfaces
$general_ip_iface = "" if $general_ip_iface eq "--";
my $device_type = $anvil->data->{nmcli}{uuid}{$uuid}{'connection.type'} // "";
my $match_interface_name = $anvil->data->{nmcli}{uuid}{$uuid}{'match.interface-name'} // "";
my $connection_autoconnect = $anvil->data->{nmcli}{uuid}{$uuid}{'connection.autoconnect'} // "";
my $active = $anvil->data->{nmcli}{uuid}{$uuid}{active};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
's1:uuid' => $uuid,
@ -1774,12 +1775,28 @@ sub reconfigure_interfaces
's3:general_ip_iface' => $general_ip_iface,
's4:device_type' => $device_type,
's5:match_interface_name' => $match_interface_name,
's6:active' => $active,
's6:connection_autoconnect' => $connection_autoconnect,
's7:active' => $active,
}});
### NOTE: I don't think this is needed, but here's the code in case we change our mind.
if (0)
{
# Try activating it.
if ((not $general_ip_iface) && (not $active))
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, 'print' => 1, key => "log_0842", variables => {
id => $connection_id,
uuid => $uuid,
}});
my $shell_call = $anvil->data->{path}{exe}{nmcli}." connection up ".$uuid;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { shell_call => $shell_call }});
my ($output, $return_code) = $anvil->System->call({shell_call => $shell_call});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
output => $output,
return_code => $return_code,
}});
# Rescan.
$anvil->Job->update_progress({
@ -1795,6 +1812,7 @@ sub reconfigure_interfaces
$anvil->Network->collect_data({debug => 2});
}
}
}
my $local_host = $anvil->Get->short_host_name();
my $prefix = $anvil->data->{config}{prefix};
@ -1885,6 +1903,16 @@ sub reconfigure_interfaces
$configure_link1 = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { configure_link1 => $configure_link1 }});
}
# Make sure that the autoconnect is enabled.
if ($anvil->data->{nmcli}{uuid}{$link1_nm_uuid}{'connection.autoconnect'} ne "yes")
{
my ($output, $return_code) = $anvil->Network->modify_connection({debug => 2, uuid => $link1_nm_uuid, variable => "connection.autoconnect", value => "yes"});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
output => $output,
return_code => $return_code,
}});
}
}
else
{
@ -1935,6 +1963,16 @@ sub reconfigure_interfaces
$configure_link2 = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { configure_link1 => $configure_link1 }});
}
# Make sure that the autoconnect is enabled.
if ($anvil->data->{nmcli}{uuid}{$link2_nm_uuid}{'connection.autoconnect'} ne "yes")
{
my ($output, $return_code) = $anvil->Network->modify_connection({debug => 2, uuid => $link2_nm_uuid, variable => "connection.autoconnect", value => "yes"});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
output => $output,
return_code => $return_code,
}});
}
}
else
{