> recycleUIDMIN = "$ (grep ^ UID_MIN/etc/login.defs | awk {'print $ 2'} 2>/dev/null)"
# If we couldn't find it, set it to the default of 1000
[-z "$ recycleUIDMIN"]; thenrecycleUIDMIN = 1000; # this is the default from/etc/login.defs
# This setting enables the 'recycling' of older unused UIDs. = no
# Function to read keyboard input.
# bash1 is broken (even ash will take read-ep!), so we work around
# it (even though bash1 is no longer supported on Slackware).
get_input () {output ["` echo $ BASH_VERSION | cut-b1 `" = "1"]; then-n "$ {1}"> & 2 ; # fudge for use with bash v1output # this should work with any other/bin/sh-ep "$ {1}" output $ output
}
# Function to display the account info
display () {goose = "$ (echo $ 2 | cut-d ''-f 2 -)"; # lop off the prefixed argument useradd needs-n "$ 1"
# If it's null then display the 'other' information [-z "$ goose"-a! -Z "$ 3"]; then "$ 3" "$ goose"
}
# Function to check whether groups exist in the/etc/group filecheck_group () {got_error group [! -Z "$ @"]; thengroup in $ @; douid_not_named = "" uid_not_num = ""-v "$ ^" $ gfile | awk-F: '{print $ 1} "| grep "^ $ {group} $">/dev/null 2> & 1 | | uid_not_named = yes-v "$ ^" $ gfile | awk-F: '{print $ 3}' | grep " ; ^ $ {group} $">/dev/null 2> & 1 | | uid_not_num = yes [! -Z "$ uid_not_named"-a! -Z "$ uid_not_num"]; then "- Group '$ group' does not exist" _error = yes
# Return exit code of 1 if at least one of the groups didn't exist [! -Z "$ got_error"]; then1
}
#: Read the login name for the new user: #
# Set the login variable to the command line param = "$ 1" = yes [! -Z $ needinput]; do [-z "$ LOGIN"]; then [-z "$ LOGIN"]; do LOGIN = "$ (get_input" Login name for new user []: ")" ;; done "^ $ {LOGIN}:" $ pfile>/dev/null 2> & 1; # ensure it's not already used [$? -Eq 0]; then "- User '$ LOGIN' already exists; please choose another" LOGIN [! "$ LOGIN" = "` echo $ LOGIN | tr AZ az `"]; then # useradd does not allow uppercase "- User '$ LOGIN' contains illegal characters (uppercase); please choose another" LOGINneedinput
# Display the user name passed from the shell if it hasn't changed ["$ 1" = "$ LOGIN"]; then "Login name for new user: $ LOGIN" p>
#: Get the UID for the user & ensure it's not already in use: #
#
# Whilst we _can_ allow users with identical UIDs, it's not a 'good thing'...