Changeset 2333 in ProjectBuilder for devel/pb/bin/pb
- Timestamp:
- Oct 24, 2017, 12:49:59 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r2327 r2333 1700 1700 } elsif ($pbos->{'type'} eq "hpux") { 1701 1701 # TODO: HP-UX 1702 } elsif ($pbos->{'type'} eq "apk") { 1703 # TODO: Alpine 1702 1704 } else { 1703 1705 die "Unknown OS type format $pbos->{'type'}"; … … 3822 3824 EOF 3823 3825 # TODO: Level of portability of these cmds ? Critical now for RM 3824 # TODO: Check existence before adding to avoid errors3826 # TODO: use an external parameter 3825 3827 print SCRIPT << "EOF"; 3826 pb_system("/usr/sbin/groupadd $pbac->{$ENV{'PBPROJ'}}","Adding group $pbac->{$ENV{'PBPROJ'}}"); 3827 pb_system("/usr/sbin/useradd -g $pbac->{$ENV{'PBPROJ'}} -m -d $home/$pbac->{$ENV{'PBPROJ'}} $pbac->{$ENV{'PBPROJ'}}","Adding user $pbac->{$ENV{'PBPROJ'}} (group $pbac->{$ENV{'PBPROJ'}} - home $home/$pbac->{$ENV{'PBPROJ'}})"); 3828 # Most Linux distros 3829 if ( -x "/usr/sbin/groupadd" ) { 3830 pb_system("/usr/sbin/groupadd $pbac->{$ENV{'PBPROJ'}}","Adding group $pbac->{$ENV{'PBPROJ'}}"); 3831 # Alpine with busybox 3832 } elsif ( -x "/usr/sbin/addgroup" ) { 3833 pb_system("/usr/sbin/addgroup $pbac->{$ENV{'PBPROJ'}}","Adding group $pbac->{$ENV{'PBPROJ'}}"); 3834 } else { 3835 die "Unable to find a command to add a group on this distribution"; 3836 } 3837 # Most Linux distros 3838 if ( -x "/usr/sbin/useradd" ) { 3839 pb_system("/usr/sbin/useradd -g $pbac->{$ENV{'PBPROJ'}} -m -d $home/$pbac->{$ENV{'PBPROJ'}} $pbac->{$ENV{'PBPROJ'}}","Adding user $pbac->{$ENV{'PBPROJ'}} (group $pbac->{$ENV{'PBPROJ'}} - home $home/$pbac->{$ENV{'PBPROJ'}})"); 3840 # Alpine with busybox 3841 } elsif ( -x "/usr/sbin/adduser" ) { 3842 pb_system("/usr/sbin/adduser -G $pbac->{$ENV{'PBPROJ'}} -h $home/$pbac->{$ENV{'PBPROJ'}} -D $pbac->{$ENV{'PBPROJ'}}","Adding user $pbac->{$ENV{'PBPROJ'}} (group $pbac->{$ENV{'PBPROJ'}} - home $home/$pbac->{$ENV{'PBPROJ'}})"); 3843 } else { 3844 die "Unable to find a command to add a user on this distribution"; 3845 } 3828 3846 } 3829 3847 EOF
Note:
See TracChangeset
for help on using the changeset viewer.