Ignore:
Timestamp:
06/05/08 16:23:10 (4 years ago)
Author:
bruno
Message:

Save current state of art :-) remains to do is the conf file for Apache with dploy-dhcp. focus on post install deloyment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/dploy-pxe/bin/dploy-pxe-post

    r62 r63  
    77 
    88use strict; 
     9use File::Basename; 
     10use File::Copy; 
    911use ProjectBuilder::Base; 
    1012use ProjectBuilder::Conf; 
     
    7173 
    7274pb_conf_add("PBCONF/dploy.conf"); 
    73 my ($pxepath) = pb_conf_get("pxepath"); 
     75my ($pathpxe) = pb_conf_get("pathpxe"); 
    7476 
    75 foreach $d ("$pxepath->{$ENV{'PBPROJ'}}", "$pxepath->{$ENV{'PBPROJ'}}/../linuxcoe", "$pxepath->{$ENV{'PBPROJ'}}/../mondorescue") { 
     77# Create dir structure 
     78foreach $d ("$pathpxe->{$ENV{'PBPROJ'}}", "$pathpxe->{$ENV{'PBPROJ'}}/../linuxcoe", "$pathpxe->{$ENV{'PBPROJ'}}/../mondorescue") { 
    7679    pb_mkdir_p($d) if ( not -d $d); 
    7780    chown $uid,$gid,$d; 
     
    7982} 
    8083 
     84# Adapt tftp xinetd conf file 
     85my $xin = ""; 
     86$xin = "/etc/xinetd.d/tftp" if (! -f $xin); 
     87$xin = "/etc/xinetd.d/tftpd" if (! -f $xin); 
     88 
     89open(XIN,$xin)  || die "Unable to read $xin: $!"; 
     90open(OUT,"$xin.tmp")  || die "Unable to write $xin.tmp: $!"; 
     91while (<XIN>) { 
     92    s/disable(\s*)=(\s*)yes/disable$1=$2no/; 
     93    s/server_args(\s*)=(\s*)(.*)/change_parms($1,$2,$3)/; 
     94    print OUT; 
     95} 
     96close(XIN); 
     97close(OUT); 
     98move("$xin.tmp",$xin); 
     99 
     100# Restart xinetd 
     101pb_system("/etc/init.d/xinetd restart","Restarting xinetd"); 
     102 
     103# Restart Apache 
     104pb_system("/etc/init.d/apache restart","Restarting Apache"); 
     105 
     106# PBHTTPDCONFDIR 
     107# Prepare Apache conf for kickstart support for LinuxCOE 
     108 
     109sub change_parms() { 
     110     
     111    my ($s1, $s2, $params) = @_; 
     112    print "# Modified by dploy.org\n"; 
     113    print "# server_args$s1=$s2$params\n"; 
     114    my $dir = dirname($pathpxe->{$ENV{'PBPROJ'}}); 
     115    $params =~ s/-s\s+\S+\s+/-s $dir/; 
     116    print "server_args$s1=$s2$params\n"; 
     117$xin)} 
Note: See TracChangeset for help on using the changeset viewer.