diff options
author | dteske <dteske@FreeBSD.org> | 2014-03-07 20:44:19 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2014-03-07 20:44:19 +0000 |
commit | 63c9b157252a9bfbaf3789532180995be543e579 (patch) | |
tree | 3400bdeb01c9fd9cbbb4537994d6e19f842cdad0 /usr.sbin/bsdconfig/usermgmt/groupedit | |
parent | 11fd7cf2992306c8b382554217a88bdaa49099d3 (diff) | |
download | FreeBSD-src-63c9b157252a9bfbaf3789532180995be543e579.zip FreeBSD-src-63c9b157252a9bfbaf3789532180995be543e579.tar.gz |
Rewrite groupmgmt -- hooking it into the scripting system with dispatch
commands groupAdd, groupDelete, and groupEdit. Getting rid of the awkward-
to-use `groupinput' bolt-on which Ron and I talked about rewriting.
Diffstat (limited to 'usr.sbin/bsdconfig/usermgmt/groupedit')
-rwxr-xr-x | usr.sbin/bsdconfig/usermgmt/groupedit | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/usr.sbin/bsdconfig/usermgmt/groupedit b/usr.sbin/bsdconfig/usermgmt/groupedit index 953f4f5..2338d57 100755 --- a/usr.sbin/bsdconfig/usermgmt/groupedit +++ b/usr.sbin/bsdconfig/usermgmt/groupedit @@ -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/group.subr f_include $BSDCFG_SHARE/usermgmt/group_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 group name, operate on it and exit # -defaultitem="" +if [ "$1" ]; then + f_group_edit "$1" + exit $SUCCESS +fi + +# +# Present a list of groups and loop until user Exits, Cancels or presses ESC +# +defaultitem= while :; do f_dialog_menu_group_list "$defaultitem" retval=$? @@ -81,8 +90,7 @@ while :; do # Anything else is a group name - $BSDCFG_LIBE/$APP_DIR/groupinput \ - ${USE_XDIALOG:+-X} mode="Edit/View" group="$mtag" + f_group_edit "$mtag" done exit $SUCCESS |