head	1.4;
access;
symbols
	RELENG_9_1_0_RELEASE:1.1
	RELENG_9_1:1.1.0.6
	RELENG_9_1_BP:1.1
	RELENG_9_0_0_RELEASE:1.1
	RELENG_9_0:1.1.0.4
	RELENG_9_0_BP:1.1
	RELENG_9:1.1.0.2
	RELENG_9_BP:1.1
	RELENG_8_BP:1.1;
locks; strict;
comment	@# @;


1.4
date	2013.06.18.00.33.05;	author svnexp;	state Exp;
branches;
next	1.3;

1.3
date	2012.12.30.06.03.14;	author svnexp;	state Exp;
branches;
next	1.2;

1.2
date	2012.10.21.18.25.12;	author nwhitehorn;	state Exp;
branches;
next	1.1;

1.1
date	2011.01.12.14.55.02;	author nwhitehorn;	state Exp;
branches;
next	;


desc
@@


1.4
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/251843
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@#! /bin/sh
# $Id: inputmenu,v 1.15 2012/07/06 18:11:21 tom Exp $
# 2002 - written by Tobias Rittweiler <tobrit@@freebits.de>

. ./setup-vars

user="$USER"
uid=`id|sed -e 's/^uid=//' -e 's/(.*//'`
gid=`id|sed -e 's/^.*gid=//' -e 's/(.*//'`
home="$HOME"

while [ ${returncode:-99} -ne 1 -a ${returncode:-99} -ne 250 ]; do
	exec 3>&1
	value=`$DIALOG \
		--clear --ok-label "Create" \
		--backtitle "An Example for the use of --inputmenu:" "$@@" \
		--inputmenu "Originally I designed --inputmenu for a \
configuration purpose. Here is a possible piece of a configuration program. \
" 20 50 10 \
"Username:" "$user" \
"UID:"      "$uid" \
"GID:"      "$gid" \
"HOME:"     "$home" \
2>&1 1>&3 `
	returncode=$?
	exec 3>&-
	case $returncode in
	$DIALOG_CANCEL)
		"$DIALOG" \
			--clear --backtitle "An Example for the use of --inputmenu:" \
			--yesno "Really quit?" 10 30
		case $? in
		$DIALOG_OK) break;;
		$DIALOG_CANCEL) returncode=99;;
		esac
		;;
	$DIALOG_OK)
		"$DIALOG" \
			--clear --backtitle "An Example for the use of --inputmenu:"  \
			--msgbox "useradd \n\
				-d $home \n\
				-u $uid \n\
				-g $gid \n\
				$user" 10 40
		;;
	$DIALOG_EXTRA)
		value=`echo "$value" | sed -e 's/^RENAMED //'`
		tag=`echo "$value" | sed -e 's/:.*//'`
		item=`echo "$value" | sed -e 's/^[^:]*:[ 	][ 	]*//'`

		case "$tag" in
		Username) user="$item" ;;
		UID)	  uid="$item"  ;;
		GID)	  gid="$item"  ;;
		HOME)	  home="$item" ;;
		esac
		;;

	$DIALOG_ESC)
		echo "ESC pressed."
		break
		;;

	esac
done
@


1.3
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/244850
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 2
a2 2
#! /bin/bash
# $Id: inputmenu,v 1.10 2010/01/13 10:29:22 tom Exp $
d7 4
a10 2
user="$USER"    ; uid="$UID"   ;
gid="$GROUPS"  ; home="$HOME"  ;
d13 5
a17 4
       exec 3>&1
       value=$("$DIALOG" --clear --ok-label "Create" \
                          --backtitle "An Example for the use of --inputmenu:" "$@@" \
                          --inputmenu "Originally I designed --inputmenu for a \
d24 16
a39 14
2>&1 1>&3 )
       returncode=$?
       exec 3>&-
       case $returncode in
       $DIALOG_CANCEL)
               "$DIALOG"  --clear --backtitle "An Example for the use of --inputmenu:" \
                               --yesno "Really quit?" 10 30
               case $? in
                       $DIALOG_OK) break;;
                       $DIALOG_CANCEL) returncode=99;;
               esac
               ;;
       $DIALOG_OK)
               "$DIALOG" --clear --backtitle "An Example for the use of --inputmenu:"  \
d45 18
a62 18
               ;;
       $DIALOG_EXTRA)
               value="${value:8:${#value}}"
               tag="${value%:*}"
               item="${value#*: }"

               case "$tag" in
                       Username) user="$item";;
                       UID) uid="$item";;
                       GID) gid="$item";;
                       HOME) home="$item";;
               esac
               ;;

       $DIALOG_ESC)
                echo "ESC pressed."
                break
                ;;
d64 1
a64 1
       esac
@


1.2
log
@SVN rev 241818 on 2012-10-21 18:25:12Z by nwhitehorn

Update dialog to 20120706: includes minor useability enhancements and
fixes for warnings encountered with clang.
@
text
@d1 2
a2 2
#! /bin/sh
# $Id: inputmenu,v 1.15 2012/07/06 18:11:21 tom Exp $
d7 2
a8 4
user="$USER"
uid=`id|sed -e 's/^uid=//' -e 's/(.*//'`
gid=`id|sed -e 's/^.*gid=//' -e 's/(.*//'`
home="$HOME"
d11 4
a14 5
	exec 3>&1
	value=`$DIALOG \
		--clear --ok-label "Create" \
		--backtitle "An Example for the use of --inputmenu:" "$@@" \
		--inputmenu "Originally I designed --inputmenu for a \
d21 14
a34 16
2>&1 1>&3 `
	returncode=$?
	exec 3>&-
	case $returncode in
	$DIALOG_CANCEL)
		"$DIALOG" \
			--clear --backtitle "An Example for the use of --inputmenu:" \
			--yesno "Really quit?" 10 30
		case $? in
		$DIALOG_OK) break;;
		$DIALOG_CANCEL) returncode=99;;
		esac
		;;
	$DIALOG_OK)
		"$DIALOG" \
			--clear --backtitle "An Example for the use of --inputmenu:"  \
d40 18
a57 18
		;;
	$DIALOG_EXTRA)
		value=`echo "$value" | sed -e 's/^RENAMED //'`
		tag=`echo "$value" | sed -e 's/:.*//'`
		item=`echo "$value" | sed -e 's/^[^:]*:[ 	][ 	]*//'`

		case "$tag" in
		Username) user="$item" ;;
		UID)	  uid="$item"  ;;
		GID)	  gid="$item"  ;;
		HOME)	  home="$item" ;;
		esac
		;;

	$DIALOG_ESC)
		echo "ESC pressed."
		break
		;;
d59 1
a59 1
	esac
@


1.1
log
@SVN rev 217309 on 2011-01-12 14:55:02Z by nwhitehorn

Update dialog to version 20100428. This changes the license under which
dialog is distributed from GPLv2 to LGPLv2 and introduces a number of new
features and a new and better libdialog API. The existing libdialog will
be kept temporarily as libodialog for compatibility purposes until sade,
sysinstall and tzsetup have been either updated or replaced.

__FreeBSD_version is now 900030.

Discussed on:	-current
Approved by:	core
Obtained from:	http://invisible-island.net/dialog
@
text
@d1 2
a2 2
#! /bin/bash
# $Id: inputmenu,v 1.10 2010/01/13 10:29:22 tom Exp $
d7 4
a10 2
user="$USER"    ; uid="$UID"   ;
gid="$GROUPS"  ; home="$HOME"  ;
d13 5
a17 4
       exec 3>&1
       value=$("$DIALOG" --clear --ok-label "Create" \
                          --backtitle "An Example for the use of --inputmenu:" "$@@" \
                          --inputmenu "Originally I designed --inputmenu for a \
d24 16
a39 14
2>&1 1>&3 )
       returncode=$?
       exec 3>&-
       case $returncode in
       $DIALOG_CANCEL)
               "$DIALOG"  --clear --backtitle "An Example for the use of --inputmenu:" \
                               --yesno "Really quit?" 10 30
               case $? in
                       $DIALOG_OK) break;;
                       $DIALOG_CANCEL) returncode=99;;
               esac
               ;;
       $DIALOG_OK)
               "$DIALOG" --clear --backtitle "An Example for the use of --inputmenu:"  \
d45 18
a62 18
               ;;
       $DIALOG_EXTRA)
               value="${value:8:${#value}}"
               tag="${value%:*}"
               item="${value#*: }"

               case "$tag" in
                       Username) user="$item";;
                       UID) uid="$item";;
                       GID) gid="$item";;
                       HOME) home="$item";;
               esac
               ;;

       $DIALOG_ESC)
                echo "ESC pressed."
                break
                ;;
d64 1
a64 1
       esac
@

