From 16de965acc36dabc66b9df213d140c4d4850109e Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 10 Nov 2005 15:18:15 +0000 Subject: configure network if needed --- rescue/partimage_whole_disk | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'rescue/partimage_whole_disk') diff --git a/rescue/partimage_whole_disk b/rescue/partimage_whole_disk index 15878505e..2fcd2ee25 100755 --- a/rescue/partimage_whole_disk +++ b/rescue/partimage_whole_disk @@ -37,6 +37,11 @@ my @partimage_cmd = ('partimage', if_($server, '-s', $server)); @ARGV == 1 or usage(); +if ($server && !is_network_configured()) { + run_program::run('drvinst', 'NETWORK'); + run_program::run('dhcp-client'); +} + run_program::run('drvinst', 'STORAGE_SCSI', 'STORAGE_IDE'); my $all_hds = fsedit::get_hds({}); @@ -255,3 +260,8 @@ sub error { log::l($msg); die "$msg\n"; } + +sub is_network_configured() { + my (undef, @l) = cat_('/proc/net/route'); + find { /^(\S+)/ && $1 ne 'lo' } @l; +} -- cgit v1.2.1