Changeset - 73da88ad939e
[Not reviewed]
0 1 0
Branko Majic (branko) - 4 years ago 2020-07-06 15:58:56
branko@majic.rs
Noticket: [factorio_manager.sh] Use read -r to avoid interpreting backslashes as escape characters.
1 file changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
games/factorio_manager.sh
Show inline comments
 
@@ -436,7 +436,7 @@ function critical_confirmation() {
 
    local exit_code="$3"
 

	
 
    echo -n "${_text_bold}${_text_yellow}[WARN] ${_text_reset}" "${prompt_text} Type YES to confirm (default is no): "
 
    read confirm
 
    read -r confirm
 

	
 
    if [[ $confirm != "YES" ]]; then
 
        error "$abort_text"
 
@@ -796,7 +796,7 @@ function read_server_settings() {
 
        while [[ ${confirmed,,} != 'y' && ${confirmed,,} != 'n' ]]; do
 
            echo
 
            colorecho -n "green" "Are you satisfied with current settings (y/n)? "
 
            read -n1 confirmed
 
            read -rn1 confirmed
 
            echo
 
        done
 

	
 
@@ -833,7 +833,7 @@ function read_server_settings() {
 
                validation_result=""
 
                until [[ $validation_result == 0 ]]; do
 

	
 
                    read -p "$prompt" -e -i "${settings_value[$key]}" value
 
                    read -r -p "$prompt" -e -i "${settings_value[$key]}" value
 

	
 
                    validate_server_setting_value "${settings_prompt[$key]}" "$value" "${settings_type[$key]}"
 
                    validation_result="$?"
 
@@ -1072,7 +1072,7 @@ function select_factorio_version() {
 
    echo
 

	
 
    while [[ -z $game_version_selected ]]; do
 
        read -e -p "Please specify what version you would like to use (enter for $default_marker): " selected_option
 
        read -r -e -p "Please specify what version you would like to use (enter for $default_marker): " selected_option
 
        [[ -z $selected_option ]] && selected_option="$default_option"
 

	
 
        if [[ $selected_option =~ ^[[:digit:]]+$ ]] && (( $selected_option >= 1 && $selected_option <= ${#game_versions_available[@]} )); then
 
@@ -2057,7 +2057,7 @@ elif [[ $command == copy ]]; then
 

	
 
        until [[ $copy_backups == "y" || $copy_backups == "n" ]]; do
 
            echo
 
            read -n1 -p "Would you like to copy backup files as well? (y/n)" copy_backups
 
            read -rn1 -p "Would you like to copy backup files as well? (y/n)" copy_backups
 
            echo
 
            copy_backups="${copy_backups,,}"
 

	
 
@@ -2197,7 +2197,7 @@ EOF
 
                echo
 
            done
 
            warning "Press any key to continue."
 
            read -n1
 
            read -rn1
 
        fi
 

	
 
        success "Finished import of instance $(colorecho -n green "$instance")."
0 comments (0 inline, 0 general)