Changeset 63 for devel/dploy-pxe/bin/dploy-pxe-post
- Timestamp:
- 06/05/08 16:23:10 (4 years ago)
- File:
-
- 1 edited
-
devel/dploy-pxe/bin/dploy-pxe-post (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
devel/dploy-pxe/bin/dploy-pxe-post
r62 r63 7 7 8 8 use strict; 9 use File::Basename; 10 use File::Copy; 9 11 use ProjectBuilder::Base; 10 12 use ProjectBuilder::Conf; … … 71 73 72 74 pb_conf_add("PBCONF/dploy.conf"); 73 my ($p xepath) = pb_conf_get("pxepath");75 my ($pathpxe) = pb_conf_get("pathpxe"); 74 76 75 foreach $d ("$pxepath->{$ENV{'PBPROJ'}}", "$pxepath->{$ENV{'PBPROJ'}}/../linuxcoe", "$pxepath->{$ENV{'PBPROJ'}}/../mondorescue") { 77 # Create dir structure 78 foreach $d ("$pathpxe->{$ENV{'PBPROJ'}}", "$pathpxe->{$ENV{'PBPROJ'}}/../linuxcoe", "$pathpxe->{$ENV{'PBPROJ'}}/../mondorescue") { 76 79 pb_mkdir_p($d) if ( not -d $d); 77 80 chown $uid,$gid,$d; … … 79 82 } 80 83 84 # Adapt tftp xinetd conf file 85 my $xin = ""; 86 $xin = "/etc/xinetd.d/tftp" if (! -f $xin); 87 $xin = "/etc/xinetd.d/tftpd" if (! -f $xin); 88 89 open(XIN,$xin) || die "Unable to read $xin: $!"; 90 open(OUT,"$xin.tmp") || die "Unable to write $xin.tmp: $!"; 91 while (<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 } 96 close(XIN); 97 close(OUT); 98 move("$xin.tmp",$xin); 99 100 # Restart xinetd 101 pb_system("/etc/init.d/xinetd restart","Restarting xinetd"); 102 103 # Restart Apache 104 pb_system("/etc/init.d/apache restart","Restarting Apache"); 105 106 # PBHTTPDCONFDIR 107 # Prepare Apache conf for kickstart support for LinuxCOE 108 109 sub 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.
