diff options
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-x | perl-install/standalone/finish-install | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/perl-install/standalone/finish-install b/perl-install/standalone/finish-install index 2c44e4f6f..81a2f00e5 100755 --- a/perl-install/standalone/finish-install +++ b/perl-install/standalone/finish-install @@ -105,9 +105,17 @@ sub ask_network() { require services; return if network::tools::has_network_connection(); - #- test again connection after waiting for network-up service + #- test again connection after waiting for network up my $w = $in->wait_message(N("Please wait"), N("Testing your connection...")); - services::start('network-up'); + if (services::starts_on_boot('NetworkManager')) { + my $time = 0; + while ($time < 20 && run_program::get_stdout('systemctl show -p SubState NetworkManager-wait-online') =~ /start/) { + $time++; + sleep(1); + } + } else { + services::start('network-up'); + } undef $w; return if network::tools::has_network_connection(); @@ -183,9 +191,12 @@ sub ask_users() { cp_f($console_dir . "/" . $old_user, $console_dir . "/" . $new_user) if -e $console_dir . "/" . $old_user; #- update user name in network configurations #- for now, only support the case of a single user name + require services; + my $using_networkmanager = services::is_service_running('NetworkManager'); foreach my $f (glob('/etc/sysconfig/network-scripts/ifcfg-*')) { if (cat_($f) =~ /\nUSERS=$old_user\n/) { run_program::run('perl', '-pi', '-e', "s,^USERS=$old_user,USERS=$new_user,", $f); + run_program::run('nmcli', 'con', 'load', $f) if $using_networkmanager; } } } |