Show
Ignore:
Timestamp:
07/24/08 15:12:02 (4 months ago)
Author:
watt
Message:

Install Script: change warning message on sudo's config problem. (ticket #76)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/centreon/libinstall/functions

    r5910 r5911  
    2020fail="$(gettext "FAIL")" 
    2121passed="$(gettext "PASSED")" 
     22warning="$(gettext "WARNING")" 
    2223critical="$(gettext "CRITICAL")" 
    2324# Init binary to empty to use pathfind or manual define 
     
    202203        local res="not_define" 
    203204        while [ "$res" != "$yes" ] && [ "$res" != "$no" ] && [ ! -z "$res" ] ; do 
    204                 echo -e "\n$message\n`gettext \"[y/n], default to [$default]:\"`" 
     205                echo -e "\n$message\n$(gettext "[y/n], default to [$default]:")" 
    205206                echo -en "> " 
    206207                read res 
     
    229230        local first=0 
    230231        while [ ! -d "$res" ] ; do 
    231                 [ $first -eq 1 ] && echo_passed "`gettext \"\$res is not a directory or does not exist.\"`" "$critical"  
     232                [ $first -eq 1 ] && echo_passed "$(gettext "\$res is not a directory or does not exist.")" "$critical"  
    232233                echo -e "\n$message" 
    233                 [ "$default" != "NO_DEFAULT" ] && echo -e "`gettext \"default to [$default]\"`" 
     234                [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to [$default]")" 
    234235                echo -en "> " 
    235236                read res 
     
    238239                fi 
    239240                if [ -z ${res#/} ] ; then 
    240                         echo_passed  "`gettext \"You select slash...\"`" 
     241                        echo_passed  "$(gettext "You select slash...")" 
    241242                        res="not_define" 
    242243                else 
     
    263264        local first=0 
    264265        while [ ! -d "$res" ] ; do 
    265                 [ $first -eq 1 ] && echo_passed "`gettext \"Directory \$res does not exists. \"`" "$critical" 
     266                [ $first -eq 1 ] && echo_passed "$(gettext "Directory \$res does not exists.")" "$critical" 
    266267                echo -e "\n$message" 
    267                 [ "$default" != "NO_DEFAULT" ] && echo -e "`gettext \"default to\"` [$default]" 
     268                [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" 
    268269                echo -en "> " 
    269270                read res 
     
    272273                fi 
    273274                if [ -z "${res#/}" -o "$yes" = "$res" -o "$no" = "$res" ] ; then 
    274                         echo_passed  "`gettext \"You select slash...\"`" 
     275                        echo_passed  "$(gettext "You select slash...")" 
    275276                        res="not_define" 
    276277                else  
    277278                        first=1 
    278279                        [ -d "$res" ] && break  
    279                         yes_no_default "`gettext \"Do you want me to create this directory ?\"` [$res]" 
     280                        yes_no_default "$(gettext "Do you want me to create this directory ?") [$res]" 
    280281                        if [ $? -eq 0 ] ; then 
    281282                                mkdir -p $res 
    282283                                if [ $? -ne 0 ] ; then 
    283                                         echo_passed "`gettext \"Could not create directory.\"`" "$critical" 
     284                                        echo_passed "$(gettext "Could not create directory.")" "$critical" 
    284285                                        #continue 
    285286                                fi 
    286                                 log "INFO" "`gettext \"Creating\"` : $res" 
     287                                log "INFO" "$(gettext "Creating") : $res" 
    287288                        fi 
    288289                fi 
     
    307308        local first=0 
    308309        while [ ! -f "$res" ] ; do 
    309                 [ $first -eq 1 ] && echo_passed "`gettext \"\$res is not a valid file.\"`" "$critical"  
     310                [ $first -eq 1 ] && echo_passed "$(gettext "\$res is not a valid file.")" "$critical"  
    310311                echo -e "\n$message" 
    311                 [ "$default" != "NO_DEFAULT" ] && echo -e "`gettext \"default to\"` [$default]" 
     312                [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" 
    312313                echo -en "> " 
    313314                read res 
     
    385386## @Globals     NAGIOS_ETC, DEFAULT_NAGIOS_ETC 
    386387#---- 
    387 function locate_nagios_etcdir() { 
     388function locate_nagios_etcdir() {/ 
    388389        if [ -z "$NAGIOS_ETC" ] ; then 
    389                 answer_with_testfile "$(gettext "Where is your nagios config file")" "$DEFAULT_NAGIOS_ETC/nagios.cfg" "NAGIOS_ETC" 
    390                 NAGIOS_ETC="$(dirname $NAGIOS_ETC)" 
     390                answer_with_testdir "$(gettext "Where is your nagios config directory")" "$DEFAULT_NAGIOS_ETC" "NAGIOS_ETC" 
    391391                echo_success "$(gettext "Path" ) $NAGIOS_ETC" "$ok" 
    392392        fi 
     
    453453## Define where is your nagiostats binary 
    454454## By default, use nagiostats,nagios2stats or nagios3stats name and find in PATH 
    455 ## @Globals     NAGIOSSTATS_BINARY, DEFAULT_NAGIOSSTATS_BINARY 
     455## @Globals     NAGIOSTATS_BINARY, DEFAULT_NAGIOSTATS_BINARY 
    456456#---- 
    457457function locate_nagiostats_binary() { 
     
    466466                done 
    467467                if [ -z "$NAGIOSTATS_BINARY" ] ; then  
    468                         answer_with_testfile "`gettext \"Where is your nagiostats binary ? \"`" "$DEFAULT_NAGIOSTATS_BINARY" "NAGIOSTATS_BINARY" 
     468                        answer_with_testfile "$(gettext "Where is your nagiostats binary ? ")" "$DEFAULT_NAGIOSTATS_BINARY" "NAGIOSTATS_BINARY" 
    469469                fi 
    470470                echo_success "$NAGIOSTATS_BINARY" "$ok" 
     
    12471247        # Add a simple test for Defaults Requiretty problem on CentOS, Fedora... 
    12481248        is_suspect_conf_sudo $SUDO_FILE 
     1249        [ "$?" -eq 1 ] && echo_warning "$(gettext "For security policy, your sudo's configuration would only run when the user is logged into a real tty. Please adjust your configuration by commenting 'Defaults requiretty' line in your configuration file.)" "$warning" 
    12491250        return 0 
    12501251}