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#
|
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
| 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
|
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 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 210 211 local mtag 212 mtag=$( 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\" \ 224 $height $width $rows \ 225 $menu_list \ 226 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 227 ) 228 local retval=$? 229 f_dialog_data_sanitize mtag 230 defaultitem="$mtag" 231 f_dprintf "retval=%s mtag=[%s]" $retval "$mtag" 232 233 if [ $retval -eq 2 ]; then 234 # The Help button was pressed 235 f_show_help "$OPTIONS_HELPFILE" 236 continue 237 elif [ $retval -ne 0 ]; then 238 break # to success 239 fi 240 241 case "$mtag" in 242 " $msg_nfs_secure") 243 f_getvar $VAR_NFS_SECURE cp 244 if [ "$cp" = "YES" ]; then 245 export $VAR_NFS_SECURE="NO" 246 else 247 export $VAR_NFS_SECURE="YES" 248 fi ;; 249 " $msg_nfs_slow") 250 f_getvar $VAR_SLOW_ETHER cp 251 if [ "$cp" = "YES" ]; then 252 export $VAR_SLOW_ETHER="NO" 253 else 254 export $VAR_SLOW_ETHER="YES" 255 fi ;; 256 " $msg_nfs_tcp") 257 f_getvar $VAR_NFS_TCP cp 258 if [ "$cp" = "YES" ]; then 259 export $VAR_NFS_TCP="NO" 260 else 261 export $VAR_NFS_TCP="YES" 262 fi ;; 263 " $msg_nfs_version_3") 264 f_getvar $VAR_NFS_V3 cp 265 if [ "$cp" = "YES" ]; then 266 export $VAR_NFS_V3="NO" 267 else 268 export $VAR_NFS_V3="YES" 269 fi ;; 270 " $msg_debugging") 271 if f_getvar $VAR_DEBUG cp && [ "$cp" ]; then 272 unset $VAR_DEBUG 273 else 274 export $VAR_DEBUG=1 275 fi ;; 276 " $msg_yes_to_all") 277 if f_getvar $VAR_NO_CONFIRM cp && [ "$cp" ]; then 278 unset $VAR_NO_CONFIRM 279 else 280 export $VAR_NO_CONFIRM=1 281 fi ;; 282 " $msg_dhcp") 283 f_getvar $VAR_TRY_DHCP cp 284 if [ "$cp" = "YES" ]; then 285 export $VAR_TRY_DHCP="NO" 286 else 287 export $VAR_TRY_DHCP="YES" 288 fi ;; 289 " $msg_ipv6") 290 f_getvar $VAR_TRY_RTSOL cp 291 if [ "$cp" = "YES" ]; then 292 export $VAR_TRY_RTSOL="NO" 293 else 294 export $VAR_TRY_RTSOL="YES" 295 fi ;; 296 " $msg_ftp_username") 297 f_media_set_ftp_userpass ;; 298 " $msg_editor") 299 f_variable_get_value $VAR_EDITOR \ 300 "$msg_please_specify_the_name_of_the_text_editor" 301 ;; 302 " $msg_release_name") 303 f_variable_get_value $VAR_RELNAME \ 304 "$msg_please_specify_the_release_you_wish_to_load" 305 ;; 306 " $msg_media_type") 307 f_media_get_type ;; 308 " $msg_media_timeout") 309 f_variable_get_value $VAR_MEDIA_TIMEOUT \ 310 "$msg_please_specify_the_number_of_seconds_to_wait" 311 ;; 312 " $msg_package_temp") 313 f_variable_get_value $VAR_PKG_TMPDIR \ 314 "$msg_please_specify_a_temporary_directory" 315 ;; 316 " $msg_rescan_devices") 317 f_device_rescan ;; 318 " $msg_use_defaults") 319 f_variable_set_defaults ;; 320 esac 321 done 322 323 # Restore old VAR_NONINTERACTIVE if needed. 324 [ "$old_interactive" ] && 325 setvar $VAR_NONINTERACTIVE "$old_interactive" 326 327 return $SUCCESS 328} 329 330############################################################ MAIN 331 332f_dprintf "%s: Successfully loaded." media/options.subr 333 334fi # ! $_MEDIA_OPTIONS_SUBR
| 71 while :; do 72 menu_list="" 73 74 f_getvar $VAR_NFS_SECURE cp 75 if [ "$cp" = "YES" ]; then menu_list="$menu_list 76 ' $msg_nfs_secure' 'YES' 77 '$msg_nfs_server_talks_only_on_a_secure_port'" 78 else menu_list="$menu_list 79 ' $msg_nfs_secure' 'NO' 80 '$msg_nfs_server_talks_only_on_a_secure_port'" 81 fi 82 83 f_getvar $VAR_SLOW_ETHER cp 84 if [ "$cp" = "YES" ]; then menu_list="$menu_list 85 ' $msg_nfs_slow' 'YES' 86 '$msg_user_is_using_a_slow_pc_or_ethernet_card'" 87 else menu_list="$menu_list 88 ' $msg_nfs_slow' 'NO' 89 '$msg_user_is_using_a_slow_pc_or_ethernet_card'" 90 fi 91 92 f_getvar $VAR_NFS_TCP cp 93 if [ "$cp" = "YES" ]; then menu_list="$menu_list 94 ' $msg_nfs_tcp' 'YES' '$msg_use_tcp_protocol_for_nfs'" 95 else menu_list="$menu_list 96 ' $msg_nfs_tcp' 'NO' '$msg_use_tcp_protocol_for_nfs'" 97 fi 98 99 f_getvar $VAR_NFS_V3 cp 100 if [ "$cp" = "YES" ]; then menu_list="$menu_list 101 ' $msg_nfs_version_3' 'YES' '$msg_use_nfs_version_3'" 102 else menu_list="$menu_list 103 ' $msg_nfs_version_3' 'NO' '$msg_use_nfs_version_3'" 104 fi 105 106 f_getvar $VAR_DEBUG cp 107 if [ "$cp" ]; then menu_list="$menu_list 108 ' $msg_debugging' 'YES' 109 '$msg_emit_extra_debugging_output'" 110 else menu_list="$menu_list 111 ' $msg_debugging' 'NO' 112 '$msg_emit_extra_debugging_output'" 113 fi 114 115 f_getvar $VAR_NO_CONFIRM cp 116 if [ "$cp" ]; then menu_list="$menu_list 117 ' $msg_yes_to_all' 'YES' 118 '$msg_assume_yes_to_all_non_critical_dialogs'" 119 else menu_list="$menu_list 120 ' $msg_yes_to_all' 'NO' 121 '$msg_assume_yes_to_all_non_critical_dialogs'" 122 fi 123 124 f_getvar $VAR_TRY_DHCP cp 125 if [ "$cp" = "YES" ]; then menu_list="$menu_list 126 ' $msg_dhcp' 'YES' 127 '$msg_attempt_automatic_dhcp_configuration'" 128 else menu_list="$menu_list 129 ' $msg_dhcp' 'NO' 130 '$msg_attempt_automatic_dhcp_configuration'" 131 fi 132 133 f_getvar $VAR_TRY_RTSOL cp 134 if [ "$cp" = "YES" ]; then menu_list="$menu_list 135 ' $msg_ipv6' 'YES' 136 '$msg_attempt_ipv6_configuration_of_interfaces'" 137 else menu_list="$menu_list 138 ' $msg_ipv6' 'NO' 139 '$msg_attempt_ipv6_configuration_of_interfaces'" 140 fi 141 142 f_getvar $VAR_FTP_USER cp 143 menu_list="$menu_list 144 ' $msg_ftp_username' '$cp' 145 '$msg_username_and_password_to_use'" 146 147 f_getvar $VAR_EDITOR cp 148 menu_list="$menu_list 149 ' $msg_editor' '$cp' '$msg_which_text_editor_to_use'" 150 151 f_getvar $VAR_RELNAME cp 152 menu_list="$menu_list 153 ' $msg_release_name' '$cp' 154 '$msg_which_release_to_attempt_to_load'" 155 156 if f_struct device_media; then 157 device_media get type cp 158 case "$cp" in 159 $DEVICE_TYPE_UFS|$DEVICE_TYPE_DISK) 160 cp="$msg_file_system";; 161 $DEVICE_TYPE_DIRECTORY) 162 cp="$msg_directory";; 163 $DEVICE_TYPE_FLOPPY) 164 cp="$msg_floppy";; 165 $DEVICE_TYPE_FTP) 166 cp="$msg_ftp";; 167 $DEVICE_TYPE_HTTP_PROXY) 168 cp="$msg_http_proxy";; 169 $DEVICE_TYPE_CDROM) 170 cp="$msg_cdrom";; 171 $DEVICE_TYPE_USB) 172 cp="$msg_usb";; 173 $DEVICE_TYPE_DOS) 174 cp="$msg_dos";; 175 $DEVICE_TYPE_NFS) 176 cp="$msg_nfs";; 177 *) 178 cp="<$msg_unknown>" 179 esac 180 else 181 cp="<$msg_not_yet_set>" 182 fi 183 menu_list="$menu_list 184 ' $msg_media_type' '$cp' 185 '$msg_the_current_installation_media_type'" 186 187 f_getvar $VAR_MEDIA_TIMEOUT cp 188 menu_list="$menu_list 189 ' $msg_media_timeout' '$cp' 190 '$msg_timeout_value_in_seconds_for_slow_media'" 191 192 f_getvar $VAR_PKG_TMPDIR cp 193 menu_list="$menu_list 194 ' $msg_package_temp' '$cp' 195 '$msg_directory_where_package_temporary_files_go'" 196 197 menu_list="$menu_list 198 ' $msg_rescan_devices' '<*>' 199 '$msg_rerun_bsdconfig_initial_device_probe' 200 ' $msg_use_defaults' '[${msg_reset}]' 201 '$msg_reset_all_values_to_startup_defaults' 202 " # END-QUOTE 203 204 local height width rows 205 eval f_dialog_menu_with_help_size height width rows \ 206 \"\$title\" \ 207 \"\$btitle\" \ 208 \"\$prompt\" \ 209 \"\$hline\" \ 210 $menu_list 211 212 local mtag 213 mtag=$( eval $DIALOG \ 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 \ 227 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 228 ) 229 local retval=$? 230 f_dialog_data_sanitize mtag 231 defaultitem="$mtag" 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
|