1if [ ! "$_NETWORKING_DEVICE_SUBR" ]; then _NETWORKING_DEVICE_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 (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/device.subr 249751 2013-04-22 05:52:06Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." networking/device.subr
34f_include $BSDCFG_SHARE/device.subr
35f_include $BSDCFG_SHARE/dialog.subr
--- 101 unchanged lines hidden (view full) ---
137 defaultitem="$defaultitem*"
138 fi
139
140 local hline="$hline_arrows_tab_enter"
141
142 #
143 # Ask user to select an interface
144 #
145 local prompt size
146 prompt="$msg_select_network_interface"
147 size=$( eval f_dialog_menu_size \
148 \"\$DIALOG_TITLE\" \
149 \"\$DIALOG_BACKTITLE\" \
150 \"\$prompt\" \
151 \"\$hline\" \
152 $interfaces )
153 local dialog_menu
154 dialog_menu=$( eval $DIALOG \
155 --title \"\$DIALOG_TITLE\" \
156 --backtitle \"\$DIALOG_BACKTITLE\" \
157 --hline \"\$hline\" \
158 --ok-label \"\$msg_ok\" \
159 --cancel-label \"\$msg_cancel\" \
160 --default-item \"\$defaultitem\" \
161 --menu \"\$prompt\" $size \
162 $interfaces \
163 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
164 )
165 local retval=$?
166 setvar DIALOG_MENU_$$ "$dialog_menu"
167 return $retval
168}
169
170# f_dialog_menu_netdev_edit $interface $ipaddr $netmask $options $dhcp
171#
172# Allow a user to edit network interface settings. Current values are not
173# probed but rather taken from the positional arguments.
174#
175f_dialog_menu_netdev_edit()
176{
177 local interface="$1" ipaddr="$2" netmask="$3" options="$4" dhcp="$5"
178 local prompt menu_list size
179
180 #
181 # Create a duplicate set of variables for change-tracking...
182 #
183 local ipaddr_orig="$2" \
184 netmask_orig="$3" \
185 options_orig="$4" \
186 dhcp_orig="$5"
--- 24 unchanged lines hidden (view full) ---
211 #
212 menu_list="
213 'X $msg_save_exit' '$msg_return_to_previous_menu'
214 '2 $msg_dhcp' '$dhcp_status'
215 '3 $msg_ipaddr4' '$ipaddr'
216 '4 $msg_netmask' '$netmask'
217 '5 $msg_options' '$options'
218 "
219 size=$( eval f_dialog_menu_size \
220 \"\$DIALOG_TITLE\" \
221 \"\$DIALOG_BACKTITLE\" \
222 \"\$prompt\" \
223 \"\$hline\" \
224 $menu_list )
225 local dialog_menu
226 dialog_menu=$( eval $DIALOG \
227 --title \"\$DIALOG_TITLE\" \
228 --backtitle \"\$DIALOG_BACKTITLE\" \
229 --hline \"\$hline\" \
230 --ok-label \"\$msg_ok\" \
231 --cancel-label \"\$msg_cancel\" \
232 --help-button \
233 --help-label \"\$msg_help\" \
234 ${USE_XDIALOG:+--help \"\"} \
235 --default-item \"\$defaultitem\" \
236 --menu \"\$prompt\" $size \
237 $menu_list \
238 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
239 )
240
241 local retval=$?
242 setvar DIALOG_MENU_$$ "$dialog_menu"
243 local tag="$( f_dialog_menutag )"
244
--- 150 unchanged lines hidden ---
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 (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/device.subr 249751 2013-04-22 05:52:06Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." networking/device.subr
34f_include $BSDCFG_SHARE/device.subr
35f_include $BSDCFG_SHARE/dialog.subr
--- 101 unchanged lines hidden (view full) ---
137 defaultitem="$defaultitem*"
138 fi
139
140 local hline="$hline_arrows_tab_enter"
141
142 #
143 # Ask user to select an interface
144 #
145 local prompt size
146 prompt="$msg_select_network_interface"
147 size=$( eval f_dialog_menu_size \
148 \"\$DIALOG_TITLE\" \
149 \"\$DIALOG_BACKTITLE\" \
150 \"\$prompt\" \
151 \"\$hline\" \
152 $interfaces )
153 local dialog_menu
154 dialog_menu=$( eval $DIALOG \
155 --title \"\$DIALOG_TITLE\" \
156 --backtitle \"\$DIALOG_BACKTITLE\" \
157 --hline \"\$hline\" \
158 --ok-label \"\$msg_ok\" \
159 --cancel-label \"\$msg_cancel\" \
160 --default-item \"\$defaultitem\" \
161 --menu \"\$prompt\" $size \
162 $interfaces \
163 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
164 )
165 local retval=$?
166 setvar DIALOG_MENU_$$ "$dialog_menu"
167 return $retval
168}
169
170# f_dialog_menu_netdev_edit $interface $ipaddr $netmask $options $dhcp
171#
172# Allow a user to edit network interface settings. Current values are not
173# probed but rather taken from the positional arguments.
174#
175f_dialog_menu_netdev_edit()
176{
177 local interface="$1" ipaddr="$2" netmask="$3" options="$4" dhcp="$5"
178 local prompt menu_list size
179
180 #
181 # Create a duplicate set of variables for change-tracking...
182 #
183 local ipaddr_orig="$2" \
184 netmask_orig="$3" \
185 options_orig="$4" \
186 dhcp_orig="$5"
--- 24 unchanged lines hidden (view full) ---
211 #
212 menu_list="
213 'X $msg_save_exit' '$msg_return_to_previous_menu'
214 '2 $msg_dhcp' '$dhcp_status'
215 '3 $msg_ipaddr4' '$ipaddr'
216 '4 $msg_netmask' '$netmask'
217 '5 $msg_options' '$options'
218 "
219 size=$( eval f_dialog_menu_size \
220 \"\$DIALOG_TITLE\" \
221 \"\$DIALOG_BACKTITLE\" \
222 \"\$prompt\" \
223 \"\$hline\" \
224 $menu_list )
225 local dialog_menu
226 dialog_menu=$( eval $DIALOG \
227 --title \"\$DIALOG_TITLE\" \
228 --backtitle \"\$DIALOG_BACKTITLE\" \
229 --hline \"\$hline\" \
230 --ok-label \"\$msg_ok\" \
231 --cancel-label \"\$msg_cancel\" \
232 --help-button \
233 --help-label \"\$msg_help\" \
234 ${USE_XDIALOG:+--help \"\"} \
235 --default-item \"\$defaultitem\" \
236 --menu \"\$prompt\" $size \
237 $menu_list \
238 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
239 )
240
241 local retval=$?
242 setvar DIALOG_MENU_$$ "$dialog_menu"
243 local tag="$( f_dialog_menutag )"
244
--- 150 unchanged lines hidden ---