#!/usr/bin/perl # #eval "exec perl -S $0 $*" # if $running_under_some_shell; #------------------------------------------------------------==ADM== # Custom Software, Developed for CUHEP by staff. # This software is in the public domain, furnished "as is", without # technical support, and with no warranty, express or implied, as # to its usefulness for any purpose. # # CreatePoolAccounts # # REVISION HISTORY # Created. 05/02/2011 doug johnson #------------------------------------------------------------------- $0 = substr($0, rindex($0, '/')+1); $| = 1; # Force immediate output. $admPath = $ENV{'ADMPATH'}; $admPath = '/usr/local/adm' unless $admPath; unshift(@INC, "$admPath/lib"); use strict; # # Definitions. Change for your site # my $debug = 0; my $start = 0; my $end = 49; my $startGID = 65000; my $newGroup = "/tmp/GlexecGroups-groups"; # # Open the output files # open(GROUP, "> $newGroup") or die " What the heck: $! $newGroup\n"; # # Generate the new group entries # my $gid = $startGID; for my $index ($start...$end) { my $newAccount = sprintf("glexec%2.2d", $index); printf " %4d $newAccount\n", $index if $debug > 0; my $groupEntry = "${newAccount}:x:${gid}"; print GROUP "$groupEntry\n"; $gid++; } exit;