Deleted Added
full compact
hostname.subr (252987) hostname.subr (256181)
1if [ ! "$_NETWORKING_HOSTNAME_SUBR" ]; then _NETWORKING_HOSTNAME_SUBR=1
2#
3# Copyright (c) 2006-2013 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 (INCLUDING, 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#
1if [ ! "$_NETWORKING_HOSTNAME_SUBR" ]; then _NETWORKING_HOSTNAME_SUBR=1
2#
3# Copyright (c) 2006-2013 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 (INCLUDING, 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/hostname.subr 252987 2013-07-07 18:51:44Z dteske $
27# $FreeBSD: head/usr.sbin/bsdconfig/networking/share/hostname.subr 256181 2013-10-09 08:12:26Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." networking/hostname.subr
34f_include $BSDCFG_SHARE/dialog.subr
35f_include $BSDCFG_SHARE/networking/common.subr

--- 69 unchanged lines hidden (view full) ---

105 msg="$msg_please_enter_fqhn"
106 fi
107
108 #
109 # Loop until the user provides taint-free input.
110 #
111 while :; do
112 f_dialog_input hostname "$msg" "$hostname" \
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." networking/hostname.subr
34f_include $BSDCFG_SHARE/dialog.subr
35f_include $BSDCFG_SHARE/networking/common.subr

--- 69 unchanged lines hidden (view full) ---

105 msg="$msg_please_enter_fqhn"
106 fi
107
108 #
109 # Loop until the user provides taint-free input.
110 #
111 while :; do
112 f_dialog_input hostname "$msg" "$hostname" \
113 "$hline_alnum_punc_tab_enter" || return
113 "$hline_alnum_punc_tab_enter" || return $?
114 # Taint-check the user's input
115 f_dialog_validate_hostname "$hostname" && break
116 done
117
118 #
119 # Save hostname only if the user changed the hostname.
120 #
121 if [ "$hostname" != "$hostname_orig" ]; then

--- 23 unchanged lines hidden (view full) ---

145 "$( hostname )" "$hostname"
146 else
147 f_yesno "$msg_activate_hostname" \
148 "$( hostname )" "$hostname" \
149 && hostname "$hostname"
150 fi
151 fi
152
114 # Taint-check the user's input
115 f_dialog_validate_hostname "$hostname" && break
116 done
117
118 #
119 # Save hostname only if the user changed the hostname.
120 #
121 if [ "$hostname" != "$hostname_orig" ]; then

--- 23 unchanged lines hidden (view full) ---

145 "$( hostname )" "$hostname"
146 else
147 f_yesno "$msg_activate_hostname" \
148 "$( hostname )" "$hostname" \
149 && hostname "$hostname"
150 fi
151 fi
152
153 return $SUCCESS
153 return $DIALOG_OK
154}
155
156############################################################ MAIN
157
158f_dprintf "%s: Successfully loaded." networking/hostname.subr
159
160fi # ! $_NETWORKING_HOSTNAME_SUBR
154}
155
156############################################################ MAIN
157
158f_dprintf "%s: Successfully loaded." networking/hostname.subr
159
160fi # ! $_NETWORKING_HOSTNAME_SUBR