X-Git-Url: https://git.cameronkatri.com/pw-darwin.git/blobdiff_plain/8a211357c3b92d1d1f9cbf325e4b4679d73b8f6d..dca2732b7d9f3eb818b44fe0038b3d3cf3c07fc2:/adduser/adduser.sh?ds=sidebyside diff --git a/adduser/adduser.sh b/adduser/adduser.sh index 3d1d6f8..4b0a6f6 100644 --- a/adduser/adduser.sh +++ b/adduser/adduser.sh @@ -28,20 +28,20 @@ # # err msg -# Display $msg on stderr, unless we're being quiet. -# +# Display $msg on stderr, unless we're being quiet. +# err() { if [ -z "$quietflag" ]; then - echo 1>&2 ${THISCMD}: ERROR: $* + echo 1>&2 ${THISCMD}: ERROR: $* fi } # info msg -# Display $msg on stdout, unless we're being quiet. -# +# Display $msg on stdout, unless we're being quiet. +# info() { if [ -z "$quietflag" ]; then - echo ${THISCMD}: INFO: $* + echo ${THISCMD}: INFO: $* fi } @@ -50,7 +50,7 @@ info() { # is not, output the value of the next higher uid that is available. # If a uid is not specified, output the first available uid, as indicated # by pw(8). -# +# get_nextuid () { _uid=$1 _nextuid= @@ -163,8 +163,7 @@ fullpath_from_shell() { # the path is invalid or it is not executable it # will emit an informational message saying so. # -shell_exists() -{ +shell_exists() { _sh="$1" _shellchk="${GREPCMD} '^$_sh$' ${ETCSHELLS} > /dev/null 2>&1" @@ -489,6 +488,7 @@ get_uid() { _prompt= if [ -n "$uuid" ]; then + uuid=`get_nextuid $uuid` _prompt="Uid [$uuid]: " else _prompt="Uid (Leave empty for default): " @@ -647,7 +647,6 @@ input_from_file() { # the user database. # input_interactive() { - _disable= _pass= _passconfirm= @@ -887,7 +886,7 @@ defaultshell="${DEFAULTSHELL}" defaultHomePerm= # Make sure the user running this program is root. This isn't a security -# measure as much as it is a usefull method of reminding the user to +# measure as much as it is a useful method of reminding the user to # 'su -' before he/she wastes time entering data that won't be saved. # procowner=${procowner:-`/usr/bin/id -u`} @@ -896,7 +895,7 @@ if [ "$procowner" != "0" ]; then exit 1 fi -# Overide from our conf file +# Override from our conf file # Quickly go through the commandline line to see if we should read # from our configuration file. The actual parsing of the commandline # arguments happens after we read in our configuration file (commandline @@ -916,7 +915,7 @@ if [ -n "$readconfig" ]; then fi fi -# Proccess command-line options +# Process command-line options # for _switch ; do case $_switch in