diff options
author | dteske <dteske@FreeBSD.org> | 2014-03-14 03:42:05 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2014-03-14 03:42:05 +0000 |
commit | fc1b773c21c561cbe8c09b09d48f80aada9bc2f9 (patch) | |
tree | 6149621431ae36292824ef5021e1d4f695247f7e /usr.sbin/bsdconfig/usermgmt/useradd | |
parent | a1988153655a46f5665608c3b5e97555128d93a4 (diff) | |
download | FreeBSD-src-fc1b773c21c561cbe8c09b09d48f80aada9bc2f9.zip FreeBSD-src-fc1b773c21c561cbe8c09b09d48f80aada9bc2f9.tar.gz |
Rewrite usermgmt -- hooking it into the scripting system with dispatch
commands addUser, deleteUser, and editUser. Getting rid of the awkward-
to-use `userinput' bolt-on which Ron and I talked about rewriting.
Diffstat (limited to 'usr.sbin/bsdconfig/usermgmt/useradd')
-rwxr-xr-x | usr.sbin/bsdconfig/usermgmt/useradd | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/usr.sbin/bsdconfig/usermgmt/useradd b/usr.sbin/bsdconfig/usermgmt/useradd index 2d6b4d0..d372be4 100755 --- a/usr.sbin/bsdconfig/usermgmt/useradd +++ b/usr.sbin/bsdconfig/usermgmt/useradd @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -33,8 +33,11 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." "$0" f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/usermgmt/user.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" +f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm && pgm="${ipgm:-$pgm}" @@ -55,9 +58,19 @@ done shift $(( $OPTIND - 1 )) # -# Chain-load to userinput to centralize code and minimize duplication +# Initialize # -$BSDCFG_LIBE/$APP_DIR/userinput ${USE_XDIALOG:+-X} mode="Add" +f_dialog_title "$msg_add $msg_user" +f_dialog_backtitle "${ipgm:+bsdconfig }$pgm" +f_mustberoot_init + +# +# Add a user +# +# NB: If given an argument on the command-line use it; otherwise fall-back to +# environment variable $user (handle $VAR_USER). +# +f_user_add ${1:+"$1"} ################################################################################ # END |