Changeset 63
- Timestamp:
- 06/05/08 16:23:10 (2 years ago)
- Files:
-
- devel/dploy-common/bin/dploy-common-post (modified) (1 diff)
- devel/dploy-dhcp/bin/dploy-dhcp-post (modified) (2 diffs)
- devel/dploy-pxe/bin/dploy-pxe-post (modified) (3 diffs)
- devel/dploy-pxe/install.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/dploy-common/bin/dploy-common-post
r62 r63 87 87 chown $uid,$gid,$keyf; 88 88 chmod 0600,$keyf; 89 90 chown $uid,$gid,PBCONF; 91 chmod 0755,PBCONF; devel/dploy-dhcp/bin/dploy-dhcp-post
r62 r63 8 8 use strict; 9 9 use ProjectBuilder::Base; 10 use ProjectBuilder::Conf; 10 11 11 12 =pod … … 54 55 my ($login,$pass,$uid,$gid,$gecos,$dir,$shell) = getpwnam($user) or die "$user not in passwd file"; 55 56 56 chown 0,$gid,"/etc/dhcpd.conf"; 57 chmod 0644,"/etc/dhcpd.conf"; 57 pb_conf_add("PBCONF/dploy.conf"); 58 my ($pathdhcp) = pb_conf_get("pathdhcp"); 59 60 chown 0,$gid,$pathdhcp->{$ENV{'PBPROJ'}}; 61 chmod 0644,$pathdhcp->{$ENV{'PBPROJ'}}; 58 62 59 63 # Include dploy in sudoers 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)} devel/dploy-pxe/install.sh
r62 r63 18 18 install -m 0755 bin/dploy-pxe-post $local/bin 19 19 20 # The script need to know where the CONFDIR is20 # The scripts need to know where the CONFDIR is 21 21 perl -pi -e "s|PBCONF|$conf|" $local/bin/dploy-add2pxe $local/bin/dploy-pxe-post
