summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/usermgmt/groupdel
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bsdconfig/usermgmt/groupdel')
-rwxr-xr-xusr.sbin/bsdconfig/usermgmt/groupdel16
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.sbin/bsdconfig/usermgmt/groupdel b/usr.sbin/bsdconfig/usermgmt/groupdel
index aa1c305..ea55489 100755
--- a/usr.sbin/bsdconfig/usermgmt/groupdel
+++ b/usr.sbin/bsdconfig/usermgmt/groupdel
@@ -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
#
+# If given a group name, operate on it and exit
+#
+if [ "$1" ]; then
+ f_group_delete "$1"
+ exit $SUCCESS
+fi
+
+#
# Loop until the user Exits, Cancels or presses ESC
#
-defaultitem=""
+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="Delete" group="$mtag"
+ f_group_delete "$mtag"
done
exit $SUCCESS
OpenPOWER on IntegriCloud