diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-11-10 15:18:15 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-11-10 15:18:15 +0000 |
commit | 16de965acc36dabc66b9df213d140c4d4850109e (patch) | |
tree | 0cd814b145b8e17236690c12b500f32d5326784e /rescue/partimage_whole_disk | |
parent | 472fd8be1e0693670dfb47c0532d8dbb805afd62 (diff) | |
download | drakx-16de965acc36dabc66b9df213d140c4d4850109e.tar drakx-16de965acc36dabc66b9df213d140c4d4850109e.tar.gz drakx-16de965acc36dabc66b9df213d140c4d4850109e.tar.bz2 drakx-16de965acc36dabc66b9df213d140c4d4850109e.tar.xz drakx-16de965acc36dabc66b9df213d140c4d4850109e.zip |
configure network if needed
Diffstat (limited to 'rescue/partimage_whole_disk')
-rwxr-xr-x | rescue/partimage_whole_disk | 10 |
1 files changed, 10 insertions, 0 deletions
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; +} |