1if [ ! "$_MEDIA_OPTIONS_SUBR" ]; then _MEDIA_OPTIONS_SUBR=1 2# 3# Copyright (c) 2012-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: 9# 1. Redistributions of source code must retain the above copyright 10# notice, this list of conditions and the following disclaimer. 11# 2. Redistributions in binary form must reproduce the above copyright 12# notice, this list of conditions and the following disclaimer in the 13# documentation and/or other materials provided with the distribution. 14# 15# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, THE 17# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 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#
| 1if [ ! "$_MEDIA_OPTIONS_SUBR" ]; then _MEDIA_OPTIONS_SUBR=1 2# 3# Copyright (c) 2012-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: 9# 1. Redistributions of source code must retain the above copyright 10# notice, this list of conditions and the following disclaimer. 11# 2. Redistributions in binary form must reproduce the above copyright 12# notice, this list of conditions and the following disclaimer in the 13# documentation and/or other materials provided with the distribution. 14# 15# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, THE 17# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 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/share/media/options.subr 250323 2013-05-07 05:40:20Z dteske $
| 27# $FreeBSD: head/usr.sbin/bsdconfig/share/media/options.subr 251190 2013-05-31 19:07:17Z dteske $
|
28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_dprintf "%s: loading includes..." media/options.subr 34f_include $BSDCFG_SHARE/dialog.subr 35f_include $BSDCFG_SHARE/struct.subr 36f_include $BSDCFG_SHARE/variable.subr 37f_include $BSDCFG_SHARE/media/any.subr 38f_include $BSDCFG_SHARE/media/ftp.subr 39 40BSDCFG_LIBE="/usr/libexec/bsdconfig" 41f_include_lang $BSDCFG_LIBE/include/messages.subr 42 43OPTIONS_HELPFILE=$BSDCFG_LIBE/include/options.hlp 44 45############################################################ FUNCTIONS 46 47# f_media_options_menu 48# 49# Prompt the user to confirm/edit various media settings. Returns success. 50# 51f_media_options_menu() 52{ 53 f_dialog_title "$msg_options_editor" 54 local title="$DIALOG_TITLE" btitle="$DIALOG_BACKTITLE" 55 f_dialog_title_restore 56 local prompt="" 57 local hline="$hline_arrows_tab_enter"
| 28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_dprintf "%s: loading includes..." media/options.subr 34f_include $BSDCFG_SHARE/dialog.subr 35f_include $BSDCFG_SHARE/struct.subr 36f_include $BSDCFG_SHARE/variable.subr 37f_include $BSDCFG_SHARE/media/any.subr 38f_include $BSDCFG_SHARE/media/ftp.subr 39 40BSDCFG_LIBE="/usr/libexec/bsdconfig" 41f_include_lang $BSDCFG_LIBE/include/messages.subr 42 43OPTIONS_HELPFILE=$BSDCFG_LIBE/include/options.hlp 44 45############################################################ FUNCTIONS 46 47# f_media_options_menu 48# 49# Prompt the user to confirm/edit various media settings. Returns success. 50# 51f_media_options_menu() 52{ 53 f_dialog_title "$msg_options_editor" 54 local title="$DIALOG_TITLE" btitle="$DIALOG_BACKTITLE" 55 f_dialog_title_restore 56 local prompt="" 57 local hline="$hline_arrows_tab_enter"
|
58 local menu_list size cp
| 58 local menu_list cp
|
59 60 # 61 # A hack so that the dialogs below are always interactive in a script 62 # 63 local old_interactive= 64 if ! f_interactive; then 65 f_getvar $VAR_NONINTERACTIVE old_interactive 66 unset $VAR_NONINTERACTIVE 67 fi 68 69 local defaultitem= 70 while :; do 71 menu_list="" 72 73 f_getvar $VAR_NFS_SECURE cp 74 if [ "$cp" = "YES" ]; then menu_list="$menu_list 75 ' $msg_nfs_secure' 'YES' 76 '$msg_nfs_server_talks_only_on_a_secure_port'" 77 else menu_list="$menu_list 78 ' $msg_nfs_secure' 'NO' 79 '$msg_nfs_server_talks_only_on_a_secure_port'" 80 fi 81 82 f_getvar $VAR_SLOW_ETHER cp 83 if [ "$cp" = "YES" ]; then menu_list="$menu_list 84 ' $msg_nfs_slow' 'YES' 85 '$msg_user_is_using_a_slow_pc_or_ethernet_card'" 86 else menu_list="$menu_list 87 ' $msg_nfs_slow' 'NO' 88 '$msg_user_is_using_a_slow_pc_or_ethernet_card'" 89 fi 90 91 f_getvar $VAR_NFS_TCP cp 92 if [ "$cp" = "YES" ]; then menu_list="$menu_list 93 ' $msg_nfs_tcp' 'YES' '$msg_use_tcp_protocol_for_nfs'" 94 else menu_list="$menu_list 95 ' $msg_nfs_tcp' 'NO' '$msg_use_tcp_protocol_for_nfs'" 96 fi 97 98 f_getvar $VAR_NFS_V3 cp 99 if [ "$cp" = "YES" ]; then menu_list="$menu_list 100 ' $msg_nfs_version_3' 'YES' '$msg_use_nfs_version_3'" 101 else menu_list="$menu_list 102 ' $msg_nfs_version_3' 'NO' '$msg_use_nfs_version_3'" 103 fi 104 105 f_getvar $VAR_DEBUG cp 106 if [ "$cp" ]; then menu_list="$menu_list 107 ' $msg_debugging' 'YES' 108 '$msg_emit_extra_debugging_output'" 109 else menu_list="$menu_list 110 ' $msg_debugging' 'NO' 111 '$msg_emit_extra_debugging_output'" 112 fi 113 114 f_getvar $VAR_NO_CONFIRM cp 115 if [ "$cp" ]; then menu_list="$menu_list 116 ' $msg_yes_to_all' 'YES' 117 '$msg_assume_yes_to_all_non_critical_dialogs'" 118 else menu_list="$menu_list 119 ' $msg_yes_to_all' 'NO' 120 '$msg_assume_yes_to_all_non_critical_dialogs'" 121 fi 122 123 f_getvar $VAR_TRY_DHCP cp 124 if [ "$cp" = "YES" ]; then menu_list="$menu_list 125 ' $msg_dhcp' 'YES' 126 '$msg_attempt_automatic_dhcp_configuration'" 127 else menu_list="$menu_list 128 ' $msg_dhcp' 'NO' 129 '$msg_attempt_automatic_dhcp_configuration'" 130 fi 131 132 f_getvar $VAR_TRY_RTSOL cp 133 if [ "$cp" = "YES" ]; then menu_list="$menu_list 134 ' $msg_ipv6' 'YES' 135 '$msg_attempt_ipv6_configuration_of_interfaces'" 136 else menu_list="$menu_list 137 ' $msg_ipv6' 'NO' 138 '$msg_attempt_ipv6_configuration_of_interfaces'" 139 fi 140 141 f_getvar $VAR_FTP_USER cp 142 menu_list="$menu_list 143 ' $msg_ftp_username' '$cp' 144 '$msg_username_and_password_to_use'" 145 146 f_getvar $VAR_EDITOR cp 147 menu_list="$menu_list 148 ' $msg_editor' '$cp' '$msg_which_text_editor_to_use'" 149 150 f_getvar $VAR_RELNAME cp 151 menu_list="$menu_list 152 ' $msg_release_name' '$cp' 153 '$msg_which_release_to_attempt_to_load'" 154 155 if f_struct device_media; then 156 device_media get type cp 157 case "$cp" in 158 $DEVICE_TYPE_UFS|$DEVICE_TYPE_DISK) 159 cp="$msg_file_system";; 160 $DEVICE_TYPE_DIRECTORY) 161 cp="$msg_directory";; 162 $DEVICE_TYPE_FLOPPY) 163 cp="$msg_floppy";; 164 $DEVICE_TYPE_FTP) 165 cp="$msg_ftp";; 166 $DEVICE_TYPE_HTTP_PROXY) 167 cp="$msg_http_proxy";; 168 $DEVICE_TYPE_CDROM) 169 cp="$msg_cdrom";; 170 $DEVICE_TYPE_USB) 171 cp="$msg_usb";; 172 $DEVICE_TYPE_DOS) 173 cp="$msg_dos";; 174 $DEVICE_TYPE_NFS) 175 cp="$msg_nfs";; 176 *) 177 cp="<$msg_unknown>" 178 esac 179 else 180 cp="<$msg_not_yet_set>" 181 fi 182 menu_list="$menu_list 183 ' $msg_media_type' '$cp' 184 '$msg_the_current_installation_media_type'" 185 186 f_getvar $VAR_MEDIA_TIMEOUT cp 187 menu_list="$menu_list 188 ' $msg_media_timeout' '$cp' 189 '$msg_timeout_value_in_seconds_for_slow_media'" 190 191 f_getvar $VAR_PKG_TMPDIR cp 192 menu_list="$menu_list 193 ' $msg_package_temp' '$cp' 194 '$msg_directory_where_package_temporary_files_go'" 195 196 menu_list="$menu_list 197 ' $msg_rescan_devices' '<*>' 198 '$msg_rerun_bsdconfig_initial_device_probe' 199 ' $msg_use_defaults' '[${msg_reset}]' 200 '$msg_reset_all_values_to_startup_defaults' 201 " # END-QUOTE 202
| 59 60 # 61 # A hack so that the dialogs below are always interactive in a script 62 # 63 local old_interactive= 64 if ! f_interactive; then 65 f_getvar $VAR_NONINTERACTIVE old_interactive 66 unset $VAR_NONINTERACTIVE 67 fi 68 69 local defaultitem= 70 while :; do 71 menu_list="" 72 73 f_getvar $VAR_NFS_SECURE cp 74 if [ "$cp" = "YES" ]; then menu_list="$menu_list 75 ' $msg_nfs_secure' 'YES' 76 '$msg_nfs_server_talks_only_on_a_secure_port'" 77 else menu_list="$menu_list 78 ' $msg_nfs_secure' 'NO' 79 '$msg_nfs_server_talks_only_on_a_secure_port'" 80 fi 81 82 f_getvar $VAR_SLOW_ETHER cp 83 if [ "$cp" = "YES" ]; then menu_list="$menu_list 84 ' $msg_nfs_slow' 'YES' 85 '$msg_user_is_using_a_slow_pc_or_ethernet_card'" 86 else menu_list="$menu_list 87 ' $msg_nfs_slow' 'NO' 88 '$msg_user_is_using_a_slow_pc_or_ethernet_card'" 89 fi 90 91 f_getvar $VAR_NFS_TCP cp 92 if [ "$cp" = "YES" ]; then menu_list="$menu_list 93 ' $msg_nfs_tcp' 'YES' '$msg_use_tcp_protocol_for_nfs'" 94 else menu_list="$menu_list 95 ' $msg_nfs_tcp' 'NO' '$msg_use_tcp_protocol_for_nfs'" 96 fi 97 98 f_getvar $VAR_NFS_V3 cp 99 if [ "$cp" = "YES" ]; then menu_list="$menu_list 100 ' $msg_nfs_version_3' 'YES' '$msg_use_nfs_version_3'" 101 else menu_list="$menu_list 102 ' $msg_nfs_version_3' 'NO' '$msg_use_nfs_version_3'" 103 fi 104 105 f_getvar $VAR_DEBUG cp 106 if [ "$cp" ]; then menu_list="$menu_list 107 ' $msg_debugging' 'YES' 108 '$msg_emit_extra_debugging_output'" 109 else menu_list="$menu_list 110 ' $msg_debugging' 'NO' 111 '$msg_emit_extra_debugging_output'" 112 fi 113 114 f_getvar $VAR_NO_CONFIRM cp 115 if [ "$cp" ]; then menu_list="$menu_list 116 ' $msg_yes_to_all' 'YES' 117 '$msg_assume_yes_to_all_non_critical_dialogs'" 118 else menu_list="$menu_list 119 ' $msg_yes_to_all' 'NO' 120 '$msg_assume_yes_to_all_non_critical_dialogs'" 121 fi 122 123 f_getvar $VAR_TRY_DHCP cp 124 if [ "$cp" = "YES" ]; then menu_list="$menu_list 125 ' $msg_dhcp' 'YES' 126 '$msg_attempt_automatic_dhcp_configuration'" 127 else menu_list="$menu_list 128 ' $msg_dhcp' 'NO' 129 '$msg_attempt_automatic_dhcp_configuration'" 130 fi 131 132 f_getvar $VAR_TRY_RTSOL cp 133 if [ "$cp" = "YES" ]; then menu_list="$menu_list 134 ' $msg_ipv6' 'YES' 135 '$msg_attempt_ipv6_configuration_of_interfaces'" 136 else menu_list="$menu_list 137 ' $msg_ipv6' 'NO' 138 '$msg_attempt_ipv6_configuration_of_interfaces'" 139 fi 140 141 f_getvar $VAR_FTP_USER cp 142 menu_list="$menu_list 143 ' $msg_ftp_username' '$cp' 144 '$msg_username_and_password_to_use'" 145 146 f_getvar $VAR_EDITOR cp 147 menu_list="$menu_list 148 ' $msg_editor' '$cp' '$msg_which_text_editor_to_use'" 149 150 f_getvar $VAR_RELNAME cp 151 menu_list="$menu_list 152 ' $msg_release_name' '$cp' 153 '$msg_which_release_to_attempt_to_load'" 154 155 if f_struct device_media; then 156 device_media get type cp 157 case "$cp" in 158 $DEVICE_TYPE_UFS|$DEVICE_TYPE_DISK) 159 cp="$msg_file_system";; 160 $DEVICE_TYPE_DIRECTORY) 161 cp="$msg_directory";; 162 $DEVICE_TYPE_FLOPPY) 163 cp="$msg_floppy";; 164 $DEVICE_TYPE_FTP) 165 cp="$msg_ftp";; 166 $DEVICE_TYPE_HTTP_PROXY) 167 cp="$msg_http_proxy";; 168 $DEVICE_TYPE_CDROM) 169 cp="$msg_cdrom";; 170 $DEVICE_TYPE_USB) 171 cp="$msg_usb";; 172 $DEVICE_TYPE_DOS) 173 cp="$msg_dos";; 174 $DEVICE_TYPE_NFS) 175 cp="$msg_nfs";; 176 *) 177 cp="<$msg_unknown>" 178 esac 179 else 180 cp="<$msg_not_yet_set>" 181 fi 182 menu_list="$menu_list 183 ' $msg_media_type' '$cp' 184 '$msg_the_current_installation_media_type'" 185 186 f_getvar $VAR_MEDIA_TIMEOUT cp 187 menu_list="$menu_list 188 ' $msg_media_timeout' '$cp' 189 '$msg_timeout_value_in_seconds_for_slow_media'" 190 191 f_getvar $VAR_PKG_TMPDIR cp 192 menu_list="$menu_list 193 ' $msg_package_temp' '$cp' 194 '$msg_directory_where_package_temporary_files_go'" 195 196 menu_list="$menu_list 197 ' $msg_rescan_devices' '<*>' 198 '$msg_rerun_bsdconfig_initial_device_probe' 199 ' $msg_use_defaults' '[${msg_reset}]' 200 '$msg_reset_all_values_to_startup_defaults' 201 " # END-QUOTE 202
|
203 size=$( eval f_dialog_menu_with_help_size \ 204 \"\$title\" \ 205 \"\$btitle\" \ 206 \"\$prompt\" \ 207 \"\$hline\" \ 208 $menu_list )
| 203 local height width rows 204 eval f_dialog_menu_with_help_size height width rows \ 205 \"\$title\" \ 206 \"\$btitle\" \ 207 \"\$prompt\" \ 208 \"\$hline\" \ 209 $menu_list
|
209 210 local dialog_menu 211 212 dialog_menu=$( eval $DIALOG \
| 210 211 local dialog_menu 212 213 dialog_menu=$( eval $DIALOG \
|
213 --title \"\$title\" \ 214 --backtitle \"\$btitle\" \ 215 --hline \"\$hline\" \ 216 --item-help \ 217 --ok-label \"\$msg_ok\" \ 218 --cancel-label \"\$msg_done\" \ 219 --help-button \ 220 --help-label \"\$msg_help\" \ 221 --default-item \"\$defaultitem\" \ 222 ${USE_XDIALOG:+--help \"\"} \ 223 --menu \"\$prompt\" $size $menu_list \
| 214 --title \"\$title\" \ 215 --backtitle \"\$btitle\" \ 216 --hline \"\$hline\" \ 217 --item-help \ 218 --ok-label \"\$msg_ok\" \ 219 --cancel-label \"\$msg_done\" \ 220 --help-button \ 221 --help-label \"\$msg_help\" \ 222 --default-item \"\$defaultitem\" \ 223 ${USE_XDIALOG:+--help \"\"} \ 224 --menu \"\$prompt\" \ 225 $height $width $rows \ 226 $menu_list \
|
224 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 225 ) 226 local retval=$? 227 setvar DIALOG_MENU_$$ "$dialog_menu" 228 defaultitem="$dialog_menu" 229 230 local mtag 231 mtag=$( f_dialog_menutag ) 232 f_dprintf "retval=%s mtag=[%s]" $retval "$mtag" 233 234 if [ $retval -eq 2 ]; then 235 # The Help button was pressed 236 f_show_help "$OPTIONS_HELPFILE" 237 continue 238 elif [ $retval -ne 0 ]; then 239 break # to success 240 fi 241 242 case "$mtag" in 243 " $msg_nfs_secure") 244 f_getvar $VAR_NFS_SECURE cp 245 if [ "$cp" = "YES" ]; then 246 export $VAR_NFS_SECURE="NO" 247 else 248 export $VAR_NFS_SECURE="YES" 249 fi ;; 250 " $msg_nfs_slow") 251 f_getvar $VAR_SLOW_ETHER cp 252 if [ "$cp" = "YES" ]; then 253 export $VAR_SLOW_ETHER="NO" 254 else 255 export $VAR_SLOW_ETHER="YES" 256 fi ;; 257 " $msg_nfs_tcp") 258 f_getvar $VAR_NFS_TCP cp 259 if [ "$cp" = "YES" ]; then 260 export $VAR_NFS_TCP="NO" 261 else 262 export $VAR_NFS_TCP="YES" 263 fi ;; 264 " $msg_nfs_version_3") 265 f_getvar $VAR_NFS_V3 cp 266 if [ "$cp" = "YES" ]; then 267 export $VAR_NFS_V3="NO" 268 else 269 export $VAR_NFS_V3="YES" 270 fi ;; 271 " $msg_debugging") 272 if f_getvar $VAR_DEBUG cp && [ "$cp" ]; then 273 unset $VAR_DEBUG 274 else 275 export $VAR_DEBUG=1 276 fi ;; 277 " $msg_yes_to_all") 278 if f_getvar $VAR_NO_CONFIRM cp && [ "$cp" ]; then 279 unset $VAR_NO_CONFIRM 280 else 281 export $VAR_NO_CONFIRM=1 282 fi ;; 283 " $msg_dhcp") 284 f_getvar $VAR_TRY_DHCP cp 285 if [ "$cp" = "YES" ]; then 286 export $VAR_TRY_DHCP="NO" 287 else 288 export $VAR_TRY_DHCP="YES" 289 fi ;; 290 " $msg_ipv6") 291 f_getvar $VAR_TRY_RTSOL cp 292 if [ "$cp" = "YES" ]; then 293 export $VAR_TRY_RTSOL="NO" 294 else 295 export $VAR_TRY_RTSOL="YES" 296 fi ;; 297 " $msg_ftp_username") 298 f_media_set_ftp_userpass ;; 299 " $msg_editor") 300 f_variable_get_value $VAR_EDITOR \ 301 "$msg_please_specify_the_name_of_the_text_editor" 302 ;; 303 " $msg_release_name") 304 f_variable_get_value $VAR_RELNAME \ 305 "$msg_please_specify_the_release_you_wish_to_load" 306 ;; 307 " $msg_media_type") 308 f_media_get_type ;; 309 " $msg_media_timeout") 310 f_variable_get_value $VAR_MEDIA_TIMEOUT \ 311 "$msg_please_specify_the_number_of_seconds_to_wait" 312 ;; 313 " $msg_package_temp") 314 f_variable_get_value $VAR_PKG_TMPDIR \ 315 "$msg_please_specify_a_temporary_directory" 316 ;; 317 " $msg_rescan_devices") 318 f_device_rescan ;; 319 " $msg_use_defaults") 320 f_variable_set_defaults ;; 321 esac 322 done 323 324 # Restore old VAR_NONINTERACTIVE if needed. 325 [ "$old_interactive" ] && 326 setvar $VAR_NONINTERACTIVE "$old_interactive" 327 328 return $SUCCESS 329} 330 331############################################################ MAIN 332 333f_dprintf "%s: Successfully loaded." media/options.subr 334 335fi # ! $_MEDIA_OPTIONS_SUBR
| 227 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 228 ) 229 local retval=$? 230 setvar DIALOG_MENU_$$ "$dialog_menu" 231 defaultitem="$dialog_menu" 232 233 local mtag 234 mtag=$( f_dialog_menutag ) 235 f_dprintf "retval=%s mtag=[%s]" $retval "$mtag" 236 237 if [ $retval -eq 2 ]; then 238 # The Help button was pressed 239 f_show_help "$OPTIONS_HELPFILE" 240 continue 241 elif [ $retval -ne 0 ]; then 242 break # to success 243 fi 244 245 case "$mtag" in 246 " $msg_nfs_secure") 247 f_getvar $VAR_NFS_SECURE cp 248 if [ "$cp" = "YES" ]; then 249 export $VAR_NFS_SECURE="NO" 250 else 251 export $VAR_NFS_SECURE="YES" 252 fi ;; 253 " $msg_nfs_slow") 254 f_getvar $VAR_SLOW_ETHER cp 255 if [ "$cp" = "YES" ]; then 256 export $VAR_SLOW_ETHER="NO" 257 else 258 export $VAR_SLOW_ETHER="YES" 259 fi ;; 260 " $msg_nfs_tcp") 261 f_getvar $VAR_NFS_TCP cp 262 if [ "$cp" = "YES" ]; then 263 export $VAR_NFS_TCP="NO" 264 else 265 export $VAR_NFS_TCP="YES" 266 fi ;; 267 " $msg_nfs_version_3") 268 f_getvar $VAR_NFS_V3 cp 269 if [ "$cp" = "YES" ]; then 270 export $VAR_NFS_V3="NO" 271 else 272 export $VAR_NFS_V3="YES" 273 fi ;; 274 " $msg_debugging") 275 if f_getvar $VAR_DEBUG cp && [ "$cp" ]; then 276 unset $VAR_DEBUG 277 else 278 export $VAR_DEBUG=1 279 fi ;; 280 " $msg_yes_to_all") 281 if f_getvar $VAR_NO_CONFIRM cp && [ "$cp" ]; then 282 unset $VAR_NO_CONFIRM 283 else 284 export $VAR_NO_CONFIRM=1 285 fi ;; 286 " $msg_dhcp") 287 f_getvar $VAR_TRY_DHCP cp 288 if [ "$cp" = "YES" ]; then 289 export $VAR_TRY_DHCP="NO" 290 else 291 export $VAR_TRY_DHCP="YES" 292 fi ;; 293 " $msg_ipv6") 294 f_getvar $VAR_TRY_RTSOL cp 295 if [ "$cp" = "YES" ]; then 296 export $VAR_TRY_RTSOL="NO" 297 else 298 export $VAR_TRY_RTSOL="YES" 299 fi ;; 300 " $msg_ftp_username") 301 f_media_set_ftp_userpass ;; 302 " $msg_editor") 303 f_variable_get_value $VAR_EDITOR \ 304 "$msg_please_specify_the_name_of_the_text_editor" 305 ;; 306 " $msg_release_name") 307 f_variable_get_value $VAR_RELNAME \ 308 "$msg_please_specify_the_release_you_wish_to_load" 309 ;; 310 " $msg_media_type") 311 f_media_get_type ;; 312 " $msg_media_timeout") 313 f_variable_get_value $VAR_MEDIA_TIMEOUT \ 314 "$msg_please_specify_the_number_of_seconds_to_wait" 315 ;; 316 " $msg_package_temp") 317 f_variable_get_value $VAR_PKG_TMPDIR \ 318 "$msg_please_specify_a_temporary_directory" 319 ;; 320 " $msg_rescan_devices") 321 f_device_rescan ;; 322 " $msg_use_defaults") 323 f_variable_set_defaults ;; 324 esac 325 done 326 327 # Restore old VAR_NONINTERACTIVE if needed. 328 [ "$old_interactive" ] && 329 setvar $VAR_NONINTERACTIVE "$old_interactive" 330 331 return $SUCCESS 332} 333 334############################################################ MAIN 335 336f_dprintf "%s: Successfully loaded." media/options.subr 337 338fi # ! $_MEDIA_OPTIONS_SUBR
|