Changeset 51


Ignore:
Timestamp:
05/02/08 16:00:33 (4 years ago)
Author:
bruno
Message:
  • Use pb functions in scripts
  • Update of concept doc
  • Check errors in dploy-add2dhcp
Location:
devel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • devel/dploy-common/lib/Dploy/Base.pm

    r48 r51  
    1212use Pod::Usage; 
    1313use English; 
     14use ProjectBuilder::Base; 
    1415 
    1516#use File::Basename; 
     
    3031# any code which uses this module. 
    3132  
    32 our $debug = 0; 
    33 our $LOG = \*STDOUT; 
     33our @ISA = qw(Exporter); 
     34our @EXPORT = qw(dploy_check_mac dploy_check_ip); 
    3435 
    35 our @ISA = qw(Exporter); 
    36 our @EXPORT = qw(dploy_syntax $debug $LOG); 
     36sub dploy_check_mac { 
    3737 
    38 sub dploy_syntax { 
     38my $mac = shift; 
    3939 
    40 # Internal mkdir -p function 
    41 sub dploy_mkdir_p { 
    42 my @dir = @_; 
    43 my $ret = mkpath(@dir, 0, 0755); 
    44 return($ret); 
     40pb_syntax(-1,0) if (not defined $mac); 
     41if ($mac !~ /^(?:[[:xdigit:]]{1,2}[-:]){5}[[:xdigit:]]{1,2}$/) { 
     42    print "Wrong MAC address\n"; 
     43    pb_syntax(-1,0); 
     44} 
     45# only lowercase for homogeneity in mac address 
     46$mac =~ tr/A-Z/a-z/; 
     47 
     48# newmac replaces : separator with - and only lowercase for dhcpd 
     49my $newmac = $mac; 
     50$newmac =~ s/:/-/g; 
     51 
     52return($newmac); 
    4553} 
    4654 
    47 # Internal rm -rf function 
    48 sub dploy_rm_rf { 
    49 my @dir = @_; 
    50 my $ret = rmtree(@dir, 0, 0); 
    51 return($ret); 
     55sub dploy_check_ip { 
     56 
     57my $ip = shift; 
     58my $cmt = shift; 
     59 
     60pb_syntax(-1,0) if (not defined $ip); 
     61if ($ip !~ /^([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])\.([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])\.([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])\.([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])$/) { 
     62        print "$cmt\n"; 
     63        pb_syntax(-1,0); 
     64    } 
    5265} 
    5366 
    54 # Internal system function 
    55 sub dploy_system { 
    56  
    57 my $cmd=shift; 
    58 my $cmt=shift || $cmd; 
    59  
    60 dploy_log(0,"$cmt... "); 
    61 #system("$cmd 2>&1 > $ENV{'PBTMP'}/system.log"); 
    62 system($cmd); 
    63 dploy_log(1,"Executing $cmd\n"); 
    64 my $res = $?; 
    65 if ($res == -1) { 
    66     dploy_log(0,"failed to execute ($cmd) : $!\n"); 
    67     dploy_display_file("$ENV{'PBTMP'}/system.log"); 
    68 } elsif ($res & 127) { 
    69     dploy_log(0, "child ($cmd) died with signal ".($? & 127).", ".($? & 128) ? 'with' : 'without'." coredump\n"); 
    70     dploy_display_file("$ENV{'PBTMP'}/system.log"); 
    71 } elsif ($res == 0) { 
    72     dploy_log(0,"OK\n"); 
    73 } else { 
    74     dploy_log(0, "child ($cmd) exited with value ".($? >> 8)."\n"); 
    75     dploy_display_file("$ENV{'PBTMP'}/system.log"); 
    76 } 
    77 return($res); 
    78 } 
    79  
    80 sub dploy_display_file { 
    81  
    82 my $file=shift; 
    83  
    84 return if (not -f $file); 
    85 open(FILE,"$file"); 
    86 while (<FILE>) { 
    87     print $_; 
    88 } 
    89 close(FILE); 
    90 } 
    91  
    92 # Function which returns a pointer on a table 
    93 # corresponding to a set of values queried in the conf file 
    94 # and test the returned vaue as they need to exist in that case 
    95 sub dploy_conf_get { 
    96  
    97 my @param = @_; 
    98 my @return = dploy_conf_get_if(@param); 
    99  
    100 die "No params found for $ENV{'PBPROJ'}" if (not @return); 
    101  
    102 foreach my $i (0..$#param) { 
    103     die "No $param[$i] defined for $ENV{'PBPROJ'}" if (not defined $return[$i]); 
    104 } 
    105 return(@return); 
    106 } 
    107  
    108 # Function which returns a pointer on a table 
    109 # corresponding to a set of values queried in the conf file 
    110 # Those value may be undef if they do not exist 
    111 sub dploy_conf_get_if { 
    112  
    113 my @param = @_; 
    114  
    115 # Everything is returned via ptr1 
    116 my @ptr1 = (); 
    117 my @ptr2 = (); 
    118 @ptr1 = dploy_conf_read_if("$ENV{'PBETC'}", @param) if (defined $ENV{'PBETC'}); 
    119 @ptr2 = dploy_conf_read_if("$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb", @param) if ((defined $ENV{'PBROOTDIR'}) and (defined $ENV{'PBPROJ'})); 
    120  
    121 my $p1; 
    122 my $p2; 
    123  
    124 dploy_log(2,"DEBUG: dploy_conf_get param1: ".Dumper(@ptr1)."\n"); 
    125 dploy_log(2,"DEBUG: dploy_conf_get param2: ".Dumper(@ptr2)."\n"); 
    126  
    127 foreach my $i (0..$#param) { 
    128     $p1 = $ptr1[$i]; 
    129     $p2 = $ptr2[$i]; 
    130     # Always try to take the param from the home dir conf file in priority 
    131     # in order to mask what could be defined under the CMS to allow for overloading 
    132     if (not defined $p2) { 
    133         # No ref in CMS project conf file so use the home dir one. 
    134         $p1->{$ENV{'PBPROJ'}} = $p1->{'default'} if ((not defined $p1->{$ENV{'PBPROJ'}}) && (defined $p1->{'default'})); 
    135     } else { 
    136         # Ref found in CMS project conf file 
    137         if (not defined $p1) { 
    138             # No ref in home dir project conf file so use the CMS one. 
    139             $p2->{$ENV{'PBPROJ'}} = $p2->{'default'} if ((not defined $p2->{$ENV{'PBPROJ'}}) && (defined $p2->{'default'})); 
    140             $p1 = $p2; 
    141         } else { 
    142             # Both are defined - handling the overloading 
    143             if (not defined $p1->{'default'}) { 
    144                 if (defined $p2->{'default'}) { 
    145                     $p1->{'default'} = $p2->{'default'}; 
    146                 } 
    147             } 
    148  
    149             if (not defined $p1->{$ENV{'PBPROJ'}}) { 
    150                 if (defined $p2->{$ENV{'PBPROJ'}}) { 
    151                     $p1->{$ENV{'PBPROJ'}} = $p2->{$ENV{'PBPROJ'}} if (defined $p2->{$ENV{'PBPROJ'}}); 
    152                 } else { 
    153                     $p1->{$ENV{'PBPROJ'}} = $p1->{'default'} if (defined $p1->{'default'}); 
    154                 } 
    155             } 
    156             # Now copy back into p1 all p2 content which doesn't exist in p1 
    157             # p1 content (local) always has priority over p2 (project) 
    158             foreach my $k (keys %$p2) { 
    159                 $p1->{$k} = $p2->{$k} if (not defined $p1->{$k}); 
    160             } 
    161         } 
    162     } 
    163     $ptr1[$i] = $p1; 
    164 } 
    165 dploy_log(2,"DEBUG: dploy_conf_get param ptr1: ".Dumper(@ptr1)."\n"); 
    166 return(@ptr1); 
    167 } 
    168  
    169 # Function which returns a pointer on a hash 
    170 # corresponding to a declaration (arg2) in a conf file (arg1) 
    171 # if that conf file doesn't exist returns undef  
    172 sub dploy_conf_read_if { 
    173  
    174 my $conffile = shift; 
    175 my @param = @_; 
    176  
    177 open(CONF,$conffile) || return((undef)); 
    178 close(CONF); 
    179 return(dploy_conf_read($conffile,@param)); 
    180 } 
    181  
    182 # Function which returns a pointer on a hash 
    183 # corresponding to a declaration (arg2) in a conf file (arg1) 
    184 sub dploy_conf_read { 
    185  
    186 my $conffile = shift; 
    187 my @param = @_; 
    188 my $trace; 
    189 my @ptr; 
    190 my %h; 
    191  
    192 open(CONF,$conffile) || die "Unable to open $conffile"; 
    193 while(<CONF>) { 
    194     if (/^\s*([A-z0-9-_]+)\s+([[A-z0-9-_]+)\s*=\s*(.+)$/) { 
    195         dploy_log(3,"DEBUG: 1:$1 2:$2 3:$3\n"); 
    196         $h{$1}{$2}=$3; 
    197     } 
    198 } 
    199 close(CONF); 
    200  
    201 for my $param (@param) { 
    202     push @ptr,$h{$param}; 
    203 } 
    204 return(@ptr); 
    205 } 
    206  
    207 # Analyze a url passed and return protocol, account, password, server, port, path 
    208 sub dploy_get_uri { 
    209  
    210 my $uri = shift || undef; 
    211  
    212 dploy_log(2,"DEBUG: uri:$uri\n"); 
    213 # A URL has the format protocol://[ac@]host[:port][path[?query][#fragment]]. 
    214 # Cf man URI 
    215 my ($scheme, $authority, $path, $query, $fragment) = 
    216          $uri =~ m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?| if (defined $uri); 
    217 my ($account,$host,$port) = $authority =~ m|(?:([^\@]+)\@)?([^:]+)(:(?:[0-9]+))?| if (defined $authority); 
    218  
    219 $scheme = "" if (not defined $scheme); 
    220 $authority = "" if (not defined $authority); 
    221 $path = "" if (not defined $path); 
    222 $account = "" if (not defined $account); 
    223 $host = "" if (not defined $host); 
    224 $port = "" if (not defined $port); 
    225  
    226 dploy_log(2,"DEBUG: scheme:$scheme ac:$account host:$host port:$port path:$path\n"); 
    227 return($scheme, $account, $host, $port, $path); 
    228 } 
    229  
    230  
    231 sub dploy_get_date { 
    232      
    233 return(localtime->sec(), localtime->min(), localtime->hour(), localtime->mday(), localtime->mon(), localtime->year(), localtime->wday(), localtime->yday(), localtime->isdst()); 
    234 } 
    235  
    236 sub dploy_log { 
    237  
    238 my $dlevel = shift; 
    239 my $msg = shift; 
    240  
    241 print $LOG "$msg" if ($dlevel <= $debug); 
    242 } 
    243  
    244 sub dploy_syntax { 
    245  
    246 my $exit_status = shift || -1; 
    247 my $verbose_level = shift || 0; 
    248  
    249 my $filehandle = \*STDERR; 
    250  
    251 $filehandle = \*STDOUT if ($exit_status == 0); 
    252  
    253 pod2usage( { -message => "Dploy.org Version PBVER-PBREV\n", 
    254              -exitval => $exit_status  , 
    255              -verbose => $verbose_level, 
    256              -output  => $filehandle } ); 
    257 } 
    258  
    259  
    260671; 
  • devel/dploy-dhcp/bin/dploy-add2dhcp

    r42 r51  
    1515use Getopt::Long qw(:config auto_abbrev no_ignore_case); 
    1616use Data::Dumper; 
     17use ProjectBuilder::Base; 
     18use Dploy::Base; 
    1719 
    1820my $logfile = "/var/log/dploy.err"; 
    1921my $dhcpmain = "/etc/dhcpd.conf"; 
    20 my $dhcpsub = ""; 
     22my $dploydir = "/etc/dploy"; 
     23 
     24my $dhcpsub = undef; 
    2125my %opts; 
    22 my $mac = ""; 
    23 my $ip = ""; 
    24 my $gw = ""; 
    25 my $dns = ""; 
    26 my $pxe = ""; 
    27 my $ntp = ""; 
    28 my $netmask = ""; 
    29 my $iprange = ""; 
    30 my $cidr = ""; 
     26my $mac = undef; 
     27my $iprange = undef; 
     28my $cidr = undef; 
     29 
     30=pod 
     31 
     32=head1 NAME 
     33 
     34dploy-add2dhcp - Update DHCP configuration file for dploy.org 
     35 
     36=head1 DESCRIPTION 
     37 
     38dploy-add2dhcp helps you keeping your DHCP configuration up to date  
     39 
     40=head1 SYNOPSIS 
     41 
     42dploy-add2dhcp -m MAC-address -i IP-address -n IP-netmask [-g IP-Gateway -d IP-dns-server -p IP-PXE-server -t IP-NTP-server] 
     43 
     44dploy-add2dhcp --mac MAC-address --ip IP-address --netmask IP-netmask [--gw IP-Gateway --dns IP-dns-server --pxe IP-PXE-server --time IP-NTP-server] 
     45 
     46=head1 OPTIONS 
     47 
     48=over 4 
     49 
     50=item B<-h|--help> 
     51 
     52Print a brief help message and exits. 
     53 
     54=cut 
     55 
     56pb_syntax_init("dploy-add2dhcp Version PBVER-PBREV\n"); 
    3157 
    3258GetOptions("help|?|h" => \$opts{'h'}, 
    33             "mac|m=s" => \$opts{'mac'}, 
     59        "mac|m=s" => \$opts{'mac'}, 
    3460        "ip|i=s" => \$opts{'ip'}, 
    3561        "netmask|n=s" => \$opts{'mask'}, 
     
    3864        "pxe|p=s" => \$opts{'pxe'}, 
    3965        "time|t=s" => \$opts{'ntp'}, 
    40     ) || dploy_syntax(-1,0); 
    41  
    42 # Mac address check 
    43 if (defined $opts{'mac'}) { 
    44   $mac = $opts{'mac'}; 
    45   if ($mac !~ /^(?:[[:xdigit:]]{1,2}[-:]){5}[[:xdigit:]]{1,2}$/) { 
    46     print "Syntax: dploy-add2dhcp MAC ip\n"; 
    47     exit(-1); 
    48   } 
    49 } 
    50 # only lowercase for homogeneity in mac address 
    51 $mac =~ tr/A-Z/a-z/; 
    52  
    53 # newmac replaces : separator with - and only lowercase for dhcpd 
    54 my $newmac = $mac; 
    55 $newmac =~ s/:/-/g; 
    56  
    57 # IP address check 
    58 if (defined $opts{'ip'}) { 
    59   $ip = $opts{'ip'}; 
    60   if ($ip !~ /^([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])\.([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])\.([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])\.([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])$/) { 
    61     print "Syntax: dploy-add2dhcp mac IP\n"; 
    62     exit(-1); 
    63   } 
    64 } 
     66    ) || pb_syntax(-1,0); 
    6567 
    6668# Other Parameters 
    6769if (defined $opts{'h'}) { 
    68   dploy_syntax(0,1); 
    69 } 
    70 if (defined $opts{'mask'}) { 
    71   $netmask = $opts{'mask'}; 
    72 } 
    73 if (defined $opts{'gw'}) { 
    74   $gw = $opts{'gw'}; 
    75 } 
    76 if (defined $opts{'pxe'}) { 
    77   $pxe = $opts{'pxe'}; 
    78 } 
     70    pb_syntax(0,1); 
     71} 
     72 
     73# Mandatory params checks 
     74$mac = dploy_check_mac($opts{'mac'}); 
     75dploy_check_ip($opts{'ip'},"Wrong IP address"); 
     76dploy_check_ip($opts{'mask'},"Wrong Netmask"); 
    7977 
    8078# Calculate IP subnet 
    81 my  $block = new Net::Netmask ($ip, $netmask); 
     79my  $block = new Net::Netmask($opts{'ip'}, $opts{'mask'}); 
    8280$iprange = $block->base(); 
    8381$cidr = $block->bits();  
    8482 
    8583# Check if a DHCP conf file already exist for the subnet 
    86 $dhcpsub="/etc/dploy/dhcp-$iprange-$cidr.conf"; 
    87 if (! -d "/etc/dploy" ) { 
    88   mkdir ("/etc/dploy",0755); 
    89 } 
     84pb_mkdir_p("$dploydir"); 
     85$dhcpsub="$dploydir/dhcp-$iprange-$cidr.conf"; 
    9086 
    9187if (! -e "$dhcpsub" ) { 
    92   # Create a DHCP file for the IP subnet 
    93   open(DHCPSUBNEW,"> $dhcpsub.new") || die "Unable to create $dhcpsub.new: $!"; 
    94     print DHCPSUBNEW "subnet $iprange netmask $netmask {\n"; 
    95     print DHCPSUBNEW "  option routers              $gw;\n"; 
    96     if (defined $opts{'dns'}) { 
    97       $dns = $opts{'dns'}; 
    98       print DHCPSUBNEW "  option domain-name-servers  $dns;\n"; 
    99     } 
    100     if (defined $opts{'ntp'}) { 
    101       $ntp = $opts{'ntp'}; 
    102       print DHCPSUBNEW "  option ntp-servers          $ntp;\n"; 
    103     } 
    104     print DHCPSUBNEW "  next-server                 $pxe;\n"; 
    105     print DHCPSUBNEW "  authoritative;\n"; 
    106     print DHCPSUBNEW "  if substring(option vendor-class-identifier, 0, 20) = \"PXEClient:Arch:00000\" {\n"; 
    107     print DHCPSUBNEW "    filename \"pxelinux.bin\";\n"; 
    108     print DHCPSUBNEW "  } else if substring(option vendor-class-identifier, 0, 20) = \"PXEClient:Arch:00002\" {\n"; 
    109     print DHCPSUBNEW "    filename \"elilo-ia64.efi\";\n"; 
    110     print DHCPSUBNEW "  }\n"; 
    111     print DHCPSUBNEW "}\n"; 
    112   close DHCPSUBNEW; 
    113   move("$dhcpsub.new",$dhcpsub); 
     88    # there are then more mandatory parameters 
     89    dploy_check_ip($opts{'gw'},"Wrong IP address for GW server"); 
     90    my $gwobj = new Net::Netmask($opts{'gw'},$opts{'mask'}); 
     91    if (($iprange != $gwobj->base()) || ($cidr != $gwobj->bits())) { 
     92        print "Gateway is not in the correct subnet \n"; 
     93        pb_syntax(-1,0); 
     94    } 
     95    # Create a DHCP file for the IP subnet 
     96    open(DHCPSUBNEW,"> $dhcpsub.new") || die "Unable to create $dhcpsub.new: $!"; 
     97    print DHCPSUBNEW "subnet $iprange netmask $opts{'mask'} {\n"; 
     98    print DHCPSUBNEW "  option routers              $opts{'gw'};\n"; 
     99    if (defined $opts{'dns'}) { 
     100        dploy_check_ip($opts{'dns'},"Wrong IP address for DNS server"); 
     101        print DHCPSUBNEW "  option domain-name-servers  $opts{'dns'};\n"; 
     102    } 
     103    if (defined $opts{'ntp'}) { 
     104        dploy_check_ip($opts{'ntp'},"Wrong IP address for NTP server"); 
     105        print DHCPSUBNEW "  option ntp-servers          $opts{'ntp'};\n"; 
     106    } 
     107    if (defined $opts{'pxe'}) { 
     108        dploy_check_ip($opts{'pxe'},"Wrong IP address for PXE server"); 
     109        print DHCPSUBNEW "  next-server                 $opts{'pxe'};\n"; 
     110        print DHCPSUBNEW "  authoritative;\n"; 
     111        print DHCPSUBNEW "  if substring(option vendor-class-identifier, 0, 20) = \"PXEClient:Arch:00000\" {\n"; 
     112        print DHCPSUBNEW "    filename \"pxelinux.bin\";\n"; 
     113        print DHCPSUBNEW "  } else if substring(option vendor-class-identifier, 0, 20) = \"PXEClient:Arch:00002\" {\n"; 
     114        print DHCPSUBNEW "    filename \"elilo-ia64.efi\";\n"; 
     115        print DHCPSUBNEW "  }\n"; 
     116    } 
     117    print DHCPSUBNEW "}\n"; 
     118    close DHCPSUBNEW; 
     119    move("$dhcpsub.new",$dhcpsub); 
    114120} 
    115121 
     
    149155        $bracket--; 
    150156    } 
    151     if (/host host-$newmac {/ .. /}\n/) { 
     157    if (/host host-$mac {/ .. /}\n/) { 
    152158        # We need to replace the old content with the new one 
    153159        print "Skip $_"; 
     
    161167} 
    162168 
    163 print DHCPSUBNEW "  host host-$newmac {\n"; 
    164 print DHCPSUBNEW "  hardware ethernet $mac;\n"; 
    165 print DHCPSUBNEW "  fixed-address $ip;\n"; 
     169print DHCPSUBNEW "  host host-$mac {\n"; 
     170print DHCPSUBNEW "  hardware ethernet $opts{'mac'};\n"; 
     171print DHCPSUBNEW "  fixed-address $opts{'ip'};\n"; 
    166172print DHCPSUBNEW "  }\n"; 
    167173print DHCPSUBNEW $lastline; 
     
    172178 
    173179# Relaunch DHCP server 
    174 system("sudo /etc/init.d/dhcpd restart"); 
     180pb_system("sudo /etc/init.d/dhcpd restart","Restarting DHCP server"); 
     181 
     182=back  
     183 
     184=head1 WEB SITES 
     185 
     186The main Web site of the project is available at L<http://www.dploy.org/>. Bug reports should be filled using the trac instance of the project at L<http://trac.dploy.org/>. 
     187 
     188=head1 USER MAILING LIST 
     189 
     190None exists for the moment. 
     191 
     192=head1 AUTHORS 
     193 
     194The dploy.org team L<http://trac.dploy.org/>. 
     195 
     196=head1 COPYRIGHT 
     197 
     198dploy.org is distributed under the GPL v2.0 license 
     199described in the file C<COPYING> included with the distribution. 
     200 
     201=cut 
     202 
  • devel/dploy-pxe/bin/dploy-add2pxe

    r50 r51  
    1818my $ksdevice = "eth0"; 
    1919my $prefix = undef; 
    20 my $mrserver = undef; 
    21 my $mrpath = undef; 
    2220 
    2321GetOptions("help|?|h" => \$opts{'h'}, 
     
    3533 
    3634# temporary mountpoint 
    37 if (not defined $ENV {'TMPDIR'}) { 
    38     $ENV{'TMPDIR'} = "/tmp"; 
    39 } 
    40 my $tmp=tempdir("dploy.XXXXXXXXXX", DIR => $ENV{'TMPDIR'}, CLEANUP => 1); 
    41 my $mnt="$tmp/iso"; 
    42 my $mnt2="$tmp/nfs"; 
     35pb_temp_init(); 
     36my $mnt="$ENV{'PBTMP'}/iso"; 
     37my $mnt2="$ENV{'PBTMP'}/nfs"; 
    4338 
    4439# Check Mac consitency  
    4540my $mac = dploy_check_mac($opt{'mac'}); 
    4641 
    47 # Check URL syntax 
    48 if (defined $opts{'url'}) { 
    49     $url = $opts{'url'}; 
    50 } 
    51  
    52 if ($url !~ /(\w+):\/\/([^\/:]+)(:\d+)?\/(.*)/) { 
    53     print "Syntax: dploy-add2pxe mac URL-TO-ISO\n"; 
    54     exit(-1); 
    55 } 
    56  
    57 # Get Mondorescue values 
    58 $mrserver = dploy_get_url(); 
    59 $mrpath = dploy_get_url(); 
     42my ($scheme, $account, $mrserver, $port, $mrpath) = pb_get_uri($opts{'url'}); 
    6043 
    6144# Get the ID given by LinuxCOE/MondoRescue to prepare kernel/initrd/ks 
     
    7154mkdir "$mnt",0755; 
    7255if ($opt{'type'} == "LinuxCOE") { 
    73     pb_system("sudo /bin/mount -o loop $linuxcoe/$iso $mnt","Error mounting $linuxcoe/$iso"); 
     56    pb_system("sudo /bin/mount -o loop $linuxcoe/$iso $mnt","Mounting $linuxcoe/$iso"); 
    7457} else if ($opt{'type'} == "MondoRescue") { 
    75     pb_system("sudo /bin/mount -t nfs $mrserver:$mrpath $mnt2","Error mountig NFS $mrserver:$mrpath"); 
    76     pb_system("sudo /bin/mount -o loop $mnt2/$prefix-1.iso $mnt","Error mounting LOOP $mnt2/$prefix-1.iso"); 
     58    pb_system("sudo /bin/mount -t nfs $mrserver:$mrpath $mnt2","Mountig NFS $mrserver:$mrpath"); 
     59    pb_system("sudo /bin/mount -o loop $mnt2/$prefix-1.iso $mnt","Mounting LOOP $mnt2/$prefix-1.iso"); 
    7760} else { 
    7861    # Type passed has parameter does not contain a valid value 
     
    8568 
    8669# Get the Command Line parameters for MondoRescue restoration 
     70my $cliparams; 
    8771open(ISOLINUX, "$mnt/isolinux.cfg") || die "Unable to open $mnt/isolinux.cfg for writing"; 
    8872while ( <ISOLINUX> ) { 
    8973    if (/label nuke/) { 
    90         my $cliparams = <ISOLINUX>;     # kernel line 
     74        $cliparams = <ISOLINUX>;        # kernel line 
    9175        $cliparams = <ISOLINUX>;        # append line 
    9276    } 
     
    9680close ISOLINUX; 
    9781# All done with ISO image... umounting 
    98 pb_system("sudo /bin/umount $mnt","Error umount ISO image); 
     82pb_system("sudo /bin/umount $mnt","Umount ISO image"); 
    9983 
    10084# Updates PXElinux 
Note: See TracChangeset for help on using the changeset viewer.