1if [ ! "$_NETWORKING_IPADDR_SUBR" ]; then _NETWORKING_IPADDR_SUBR=1
2#
3# Copyright (c) 2006-2012 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr 240768 2012-09-20 23:44:13Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_include $BSDCFG_SHARE/sysrc.subr
34f_include $BSDCFG_SHARE/dialog.subr
35f_include $BSDCFG_SHARE/strings.subr
--- 126 unchanged lines hidden (view full) ---
162 "$msg" \
163 "$_ipaddr" \
164 "$hline" )"
165
166 #
167 # Loop until the user provides taint-free input.
168 #
169 while :; do
170 local dialog_inputbox
171 dialog_inputbox=$( eval $DIALOG \
172 --title \"\$DIALOG_TITLE\" \
173 --backtitle \"\$DIALOG_BACKTITLE\" \
174 --hline \"\$hline\" \
175 --ok-label \"\$msg_ok\" \
176 --cancel-label \"\$msg_cancel\" \
177 --inputbox \"\$msg\" $size \
178 \"\$_ipaddr\" \
179 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
180 )
181
182 local retval=$?
183 setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox"
184 _input=$( f_dialog_inputstr )
185
186 #
187 # Return error status if:
188 # - User has not made any changes to the given value
189 # - User has either pressed ESC or chosen Cancel/No
190 #
191 [ "$_ipaddr" = "$_input" ] && return $FAILURE
--- 48 unchanged lines hidden ---
2#
3# Copyright (c) 2006-2012 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr 240768 2012-09-20 23:44:13Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_include $BSDCFG_SHARE/sysrc.subr
34f_include $BSDCFG_SHARE/dialog.subr
35f_include $BSDCFG_SHARE/strings.subr
--- 126 unchanged lines hidden (view full) ---
162 "$msg" \
163 "$_ipaddr" \
164 "$hline" )"
165
166 #
167 # Loop until the user provides taint-free input.
168 #
169 while :; do
170 local dialog_inputbox
171 dialog_inputbox=$( eval $DIALOG \
172 --title \"\$DIALOG_TITLE\" \
173 --backtitle \"\$DIALOG_BACKTITLE\" \
174 --hline \"\$hline\" \
175 --ok-label \"\$msg_ok\" \
176 --cancel-label \"\$msg_cancel\" \
177 --inputbox \"\$msg\" $size \
178 \"\$_ipaddr\" \
179 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
180 )
181
182 local retval=$?
183 setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox"
184 _input=$( f_dialog_inputstr )
185
186 #
187 # Return error status if:
188 # - User has not made any changes to the given value
189 # - User has either pressed ESC or chosen Cancel/No
190 #
191 [ "$_ipaddr" = "$_input" ] && return $FAILURE
--- 48 unchanged lines hidden ---