Changeset 5911 for trunk/centreon/libinstall/functions
- Timestamp:
- 07/24/08 15:12:02 (4 months ago)
- Files:
-
- 1 modified
-
trunk/centreon/libinstall/functions (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/centreon/libinstall/functions
r5910 r5911 20 20 fail="$(gettext "FAIL")" 21 21 passed="$(gettext "PASSED")" 22 warning="$(gettext "WARNING")" 22 23 critical="$(gettext "CRITICAL")" 23 24 # Init binary to empty to use pathfind or manual define … … 202 203 local res="not_define" 203 204 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]:")" 205 206 echo -en "> " 206 207 read res … … 229 230 local first=0 230 231 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" 232 233 echo -e "\n$message" 233 [ "$default" != "NO_DEFAULT" ] && echo -e " `gettext \"default to [$default]\"`"234 [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to [$default]")" 234 235 echo -en "> " 235 236 read res … … 238 239 fi 239 240 if [ -z ${res#/} ] ; then 240 echo_passed " `gettext \"You select slash...\"`"241 echo_passed "$(gettext "You select slash...")" 241 242 res="not_define" 242 243 else … … 263 264 local first=0 264 265 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" 266 267 echo -e "\n$message" 267 [ "$default" != "NO_DEFAULT" ] && echo -e " `gettext \"default to\"`[$default]"268 [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" 268 269 echo -en "> " 269 270 read res … … 272 273 fi 273 274 if [ -z "${res#/}" -o "$yes" = "$res" -o "$no" = "$res" ] ; then 274 echo_passed " `gettext \"You select slash...\"`"275 echo_passed "$(gettext "You select slash...")" 275 276 res="not_define" 276 277 else 277 278 first=1 278 279 [ -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]" 280 281 if [ $? -eq 0 ] ; then 281 282 mkdir -p $res 282 283 if [ $? -ne 0 ] ; then 283 echo_passed " `gettext \"Could not create directory.\"`" "$critical"284 echo_passed "$(gettext "Could not create directory.")" "$critical" 284 285 #continue 285 286 fi 286 log "INFO" " `gettext \"Creating\"`: $res"287 log "INFO" "$(gettext "Creating") : $res" 287 288 fi 288 289 fi … … 307 308 local first=0 308 309 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" 310 311 echo -e "\n$message" 311 [ "$default" != "NO_DEFAULT" ] && echo -e " `gettext \"default to\"`[$default]"312 [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" 312 313 echo -en "> " 313 314 read res … … 385 386 ## @Globals NAGIOS_ETC, DEFAULT_NAGIOS_ETC 386 387 #---- 387 function locate_nagios_etcdir() { 388 function locate_nagios_etcdir() {/ 388 389 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" 391 391 echo_success "$(gettext "Path" ) $NAGIOS_ETC" "$ok" 392 392 fi … … 453 453 ## Define where is your nagiostats binary 454 454 ## By default, use nagiostats,nagios2stats or nagios3stats name and find in PATH 455 ## @Globals NAGIOS STATS_BINARY, DEFAULT_NAGIOSSTATS_BINARY455 ## @Globals NAGIOSTATS_BINARY, DEFAULT_NAGIOSTATS_BINARY 456 456 #---- 457 457 function locate_nagiostats_binary() { … … 466 466 done 467 467 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" 469 469 fi 470 470 echo_success "$NAGIOSTATS_BINARY" "$ok" … … 1247 1247 #Â Add a simple test for Defaults Requiretty problem on CentOS, Fedora... 1248 1248 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" 1249 1250 return 0 1250 1251 }
