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 240684 2012-09-18 22:28:42Z 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 eval $DIALOG \
171 --title \"\$DIALOG_TITLE\" \
172 --backtitle \"\$DIALOG_BACKTITLE\" \
173 --hline \"\$hline\" \
174 --ok-label \"\$msg_ok\" \
175 --cancel-label \"\$msg_cancel\" \
176 --inputbox \"\$msg\" $size \
177 \"\$_ipaddr\" \
178 2> "$DIALOG_TMPDIR/dialog.inputbox.$$"
179
180 local retval=$?
181 _input=$( f_dialog_inputstr )
182
183 #
184 # Return error status if:
185 # - User has not made any changes to the given value
186 # - User has either pressed ESC or chosen Cancel/No
187 #
188 [ "$_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 240684 2012-09-18 22:28:42Z 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 eval $DIALOG \
171 --title \"\$DIALOG_TITLE\" \
172 --backtitle \"\$DIALOG_BACKTITLE\" \
173 --hline \"\$hline\" \
174 --ok-label \"\$msg_ok\" \
175 --cancel-label \"\$msg_cancel\" \
176 --inputbox \"\$msg\" $size \
177 \"\$_ipaddr\" \
178 2> "$DIALOG_TMPDIR/dialog.inputbox.$$"
179
180 local retval=$?
181 _input=$( f_dialog_inputstr )
182
183 #
184 # Return error status if:
185 # - User has not made any changes to the given value
186 # - User has either pressed ESC or chosen Cancel/No
187 #
188 [ "$_ipaddr" = "$_input" ] && return $FAILURE
--- 48 unchanged lines hidden ---