summaryrefslogtreecommitdiffstats
path: root/rescue/partimage_whole_disk
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-11-10 15:18:15 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-11-10 15:18:15 +0000
commit16de965acc36dabc66b9df213d140c4d4850109e (patch)
tree0cd814b145b8e17236690c12b500f32d5326784e /rescue/partimage_whole_disk
parent472fd8be1e0693670dfb47c0532d8dbb805afd62 (diff)
downloaddrakx-backup-do-not-use-16de965acc36dabc66b9df213d140c4d4850109e.tar
drakx-backup-do-not-use-16de965acc36dabc66b9df213d140c4d4850109e.tar.gz
drakx-backup-do-not-use-16de965acc36dabc66b9df213d140c4d4850109e.tar.bz2
drakx-backup-do-not-use-16de965acc36dabc66b9df213d140c4d4850109e.tar.xz
drakx-backup-do-not-use-16de965acc36dabc66b9df213d140c4d4850109e.zip
configure network if needed
Diffstat (limited to 'rescue/partimage_whole_disk')
-rwxr-xr-xrescue/partimage_whole_disk10
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;
+}