diff options
Diffstat (limited to 'usr.sbin/bsdconfig/usermgmt/userdel')
-rwxr-xr-x | usr.sbin/bsdconfig/usermgmt/userdel | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.sbin/bsdconfig/usermgmt/userdel b/usr.sbin/bsdconfig/usermgmt/userdel index 33aa062..9425c7b 100755 --- a/usr.sbin/bsdconfig/usermgmt/userdel +++ b/usr.sbin/bsdconfig/usermgmt/userdel @@ -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 @@ -34,6 +34,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" 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 f_include $BSDCFG_SHARE/usermgmt/user_input.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" @@ -65,9 +66,17 @@ f_dialog_backtitle "${ipgm:+bsdconfig }$pgm" f_mustberoot_init # +# If given a user name, operate on it and exit +# +if [ "$1" ]; then + f_user_delete "$1" + exit $SUCCESS +fi + +# # Loop until the user Exits, Cancels or presses ESC # -defaultitem="" +defaultitem= while :; do f_dialog_menu_user_list "$defaultitem" retval=$? @@ -81,8 +90,7 @@ while :; do # Anything else is a userid - $BSDCFG_LIBE/$APP_DIR/userinput \ - ${USE_XDIALOG:+-X} mode="Delete" user="$mtag" + f_user_delete "$mtag" done exit $SUCCESS |