summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/usermgmt/useredit
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bsdconfig/usermgmt/useredit')
-rwxr-xr-xusr.sbin/bsdconfig/usermgmt/useredit18
1 files changed, 13 insertions, 5 deletions
diff --git a/usr.sbin/bsdconfig/usermgmt/useredit b/usr.sbin/bsdconfig/usermgmt/useredit
index 30ee578..612f3a6 100755
--- a/usr.sbin/bsdconfig/usermgmt/useredit
+++ b/usr.sbin/bsdconfig/usermgmt/useredit
@@ -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
#
-# Loop until the user Exits, Cancels or presses ESC
+# If given a user name, operate on it and exit
#
-defaultitem=""
+if [ "$1" ]; then
+ f_user_edit "$1"
+ exit $SUCCESS
+fi
+
+#
+# Present a list of users and loop until user Exits, Cancels or presses ESC
+#
+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="Edit/View" user="$mtag"
+ f_user_edit "$mtag"
done
exit $SUCCESS
OpenPOWER on IntegriCloud