summaryrefslogtreecommitdiffstats
path: root/perl-install/network.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/network.pm')
-rw-r--r--perl-install/network.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/perl-install/network.pm b/perl-install/network.pm
index e471734bc..3f028f320 100644
--- a/perl-install/network.pm
+++ b/perl-install/network.pm
@@ -10,6 +10,7 @@ use Socket;
use common qw(:common :file :system :functional);
use detect_devices;
+use run_program;
use log;
#-######################################################################################
@@ -47,6 +48,14 @@ sub read_interface_conf {
\%intf;
}
+sub up_it {
+ my ($prefix, $intfs) = @_;
+ $_->{isUp} and return foreach @$intfs;
+ my $f = "/etc/resolv.conf"; symlink "$prefix/$f", $f;
+ run_program::rooted($prefix, "/etc/rc.d/init.d/network", "start");
+ $_->{isUp} = 1 foreach @$intfs;
+}
+
sub write_conf {
my ($file, $netc) = @_;
@@ -148,7 +157,10 @@ sub sethostname {
sub resolv($) {
my ($name) = @_;
- is_ip($name) ? $name : join(".", unpack "C4", (gethostbyname $name)[4]);
+ is_ip($name) and return $name;
+ my $a = join(".", unpack "C4", (gethostbyname $name)[4]);
+ log::l("resolved $name in $a");
+ $a;
}
sub dnsServers {