Changeset 1842 in MondoRescue for branches/stable/mindi/mindi-bkphw
- Timestamp:
- Dec 15, 2007, 2:24:34 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/mindi-bkphw
r1770 r1842 1 1 #!/usr/bin/perl -w 2 # 3 # $Id$ 2 4 # 3 5 # Backup the hardware configuration on machine supporting it … … 13 15 my $confdir = "$ARGV[1]"; 14 16 15 my $tool = "";16 my $tooldir = "";17 my $ret = 0;18 19 17 mkdir $bkpdir,0755 if (! -d $bkpdir) ; 20 open(SYSTEM," dmidecode -s 'system-product-name' |") || die "You needdmidecode for mindi hardware support";18 open(SYSTEM,"/usr/sbin/dmidecode -s 'system-product-name' |") || die "You need /usr/sbin/dmidecode for mindi hardware support"; 21 19 my $productname = <SYSTEM>; 22 20 close(SYSTEM); 23 21 22 die "No product name found for Hardware support\n" if (not defined $productname); 23 24 24 chomp($productname); 25 25 if ($productname =~ /proliant/i) { 26 print "Detected a n HP Hardware. Nice. Continue to support my job :-)\n";26 print "Detected a $productname. Nice. Continue to support my job :-)\n"; 27 27 print "Activating Proliant support for mindi\n"; 28 28 open(PROLIANT,"$confdir/proliant.files") || die "Unable to open $confdir/proliant.files"; 29 29 open(TOOLS,"> $bkpdir/../tools.files") || die "Unable to open $bkpdir/../tools.files"; 30 30 open(SCRIPT,"> $bkpdir/../mindi-rsthw") || die "Unable to open $bkpdir/../mindi-rsthw"; 31 print SCRIPT << "EOF";31 print SCRIPT << 'EOF'; 32 32 #!/bin/bash 33 33 # … … 38 38 # may have an impact on you restoration process 39 39 # 40 # put dynamic libraries at an accessible place 41 for l in /usr/local/lib/*; do 42 ln -sf $l /usr/lib 43 done 40 44 EOF 41 45 while($tool = <PROLIANT>) { … … 52 56 } 53 57 if ($tool =~ /\/conrep$/) { 54 $ret = system(" (cd $tooldir ; $tool -s -f$bkpdir/conrep.dat)");55 print SCRIPT "(cd $tooldir ; $tool - s -f$bkpdir/conrep.dat)");58 $ret = system("cd $tooldir ; $tool -s -f$bkpdir/conrep.dat"); 59 print SCRIPT "(cd $tooldir ; $tool -l -f$bkpdir/conrep.dat)\n"; 56 60 print TOOLS "$tool.xml\n"; 57 61 } 58 if ($tool =~ /\/cpqacuxe$/) { 59 $ret = system("$tool -c $bkpdir/cpqacuxe.dat"); 60 print SCRIPT "$tool -r $bkpdir/cpqacuxe.dat"); 62 if ($tool =~ /\/.acuxebin$/) { 63 my $dir=basename($tool); 64 $ret = system("export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -c $bkpdir/cpqacuxe.dat"); 65 print SCRIPT "export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -i $bkpdir/cpqacuxe.dat\n"; 61 66 print TOOLS "$tooldir/bld\n"; 62 67 } 63 68 if ($tool =~ /\/hponcfg$/) { 64 69 $ret = system("$tool -w $bkpdir/hponcfg.dat"); 65 print SCRIPT "$tool -r $bkpdir/hponcfg.dat ");70 print SCRIPT "$tool -r $bkpdir/hponcfg.dat\n"; 66 71 } 67 72 if ($tool =~ /\.scexe$/) { 68 print SCRIPT "$tool ");73 print SCRIPT "$tool\n"; 69 74 } 70 75 if ($ret != 0) { … … 77 82 } else { 78 83 print "No Hardware support for $productname\n"; 79 print " Ask your manufacturer to contribute to the mindi project\n";84 print "You may ask your manufacturer to contribute to the mindi project\n"; 80 85 } 81 86 rmdir $bkpdir if (-d $bkpdir) ;
Note:
See TracChangeset
for help on using the changeset viewer.