useradd revision 260678
1241675Suqs#!/bin/sh 2241675Suqs#- 3241675Suqs# Copyright (c) 2012 Ron McDowell 4241675Suqs# Copyright (c) 2012-2013 Devin Teske 5241675Suqs# All rights reserved. 6241675Suqs# 7241675Suqs# Redistribution and use in source and binary forms, with or without 8241675Suqs# modification, are permitted provided that the following conditions 9241675Suqs# are met: 10241675Suqs# 1. Redistributions of source code must retain the above copyright 11241675Suqs# notice, this list of conditions and the following disclaimer. 12241675Suqs# 2. Redistributions in binary form must reproduce the above copyright 13241675Suqs# notice, this list of conditions and the following disclaimer in the 14241675Suqs# documentation and/or other materials provided with the distribution. 15241675Suqs# 16241675Suqs# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17241675Suqs# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18241675Suqs# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19241675Suqs# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20241675Suqs# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21241675Suqs# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22241675Suqs# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23241675Suqs# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24241675Suqs# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25241675Suqs# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26241675Suqs# SUCH DAMAGE. 27241675Suqs# 28241675Suqs# $FreeBSD: stable/10/usr.sbin/bsdconfig/usermgmt/useradd 260678 2014-01-15 07:49:17Z dteske $ 29241675Suqs# 30241675Suqs############################################################ INCLUDES 31241675Suqs 32241675SuqsBSDCFG_SHARE="/usr/share/bsdconfig" 33241675Suqs. $BSDCFG_SHARE/common.subr || exit 1 34241675Suqsf_dprintf "%s: loading includes..." "$0" 35241675Suqsf_include $BSDCFG_SHARE/dialog.subr 36241675Suqs 37241675SuqsBSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" 38241675Suqs 39241675Suqsf_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm && 40241675Suqs pgm="${ipgm:-$pgm}" 41241675Suqs 42241675Suqs############################################################ MAIN 43241675Suqs 44241675Suqs# Incorporate rc-file if it exists 45241675Suqs[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" 46241675Suqs 47241675Suqs# 48241675Suqs# Process command-line arguments 49241675Suqs# 50241675Suqswhile getopts h$GETOPTS_STDARGS flag; do 51241675Suqs case "$flag" in 52241675Suqs h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm" ;; 53241675Suqs esac 54241675Suqsdone 55241675Suqsshift $(( $OPTIND - 1 )) 56241675Suqs 57241675Suqs# 58241675Suqs# Chain-load to userinput to centralize code and minimize duplication 59241675Suqs# 60241675Suqs$BSDCFG_LIBE/$APP_DIR/userinput ${USE_XDIALOG:+-X} mode="Add" 61241675Suqs 62241675Suqs################################################################################ 63241675Suqs# END 64241675Suqs################################################################################ 65241675Suqs