- Timestamp:
- 08/05/08 17:40:48 (4 years ago)
- File:
-
- 1 edited
-
devel/dploy-dhcp/bin/dploy-dhcp-post (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
devel/dploy-dhcp/bin/dploy-dhcp-post
r63 r67 26 26 =back 27 27 28 No option nor parameter upported28 No option nor parameter supported 29 29 30 30 =head1 WEB SITES … … 47 47 =cut 48 48 49 my $proj = "PBPROJ"; 50 51 pb_conf_init($proj); 49 52 pb_syntax_init("dploy-dhcp-post\n"); 50 53 … … 52 55 53 56 # Get dploy account info 54 my $user = "PBPROJ";57 my $user = $proj; 55 58 my ($login,$pass,$uid,$gid,$gecos,$dir,$shell) = getpwnam($user) or die "$user not in passwd file"; 56 59 57 pb_conf_add("PBCONF/ dploy.conf");60 pb_conf_add("PBCONF/$proj.conf"); 58 61 my ($pathdhcp) = pb_conf_get("pathdhcp"); 59 62 60 chown 0,$gid, $pathdhcp->{$ENV{'PBPROJ'}};61 chmod 0644, $pathdhcp->{$ENV{'PBPROJ'}};63 chown 0,$gid,"$pathdhcp->{$proj}"; 64 chmod 0644,"$pathdhcp->{$proj}"; 62 65 63 66 # Include dploy in sudoers … … 65 68 open(SUDO,"/etc/sudoers") || die "Unable to read /etc/sudoers"; 66 69 while (<SUDO>) { 67 $found = 1 if ((/^ PBPROJ/) && (/\/init.d\/dhcpd/));70 $found = 1 if ((/^$proj/) && (/\/init.d\/dhcpd/)); 68 71 } 69 72 close(SUDO); … … 71 74 if ($found == 0) { 72 75 open(SUDO,">> /etc/sudoers") || die "Unable to write /etc/sudoers"; 73 print SUDO " PBPROJALL=NOPASSWD: /etc/init.d/dhcpd ?*\n";76 print SUDO "$proj ALL=NOPASSWD: /etc/init.d/dhcpd ?*\n"; 74 77 close(SUDO); 75 78 }
Note: See TracChangeset
for help on using the changeset viewer.
