diff options
-rw-r--r-- | configure.in | 98 |
1 files changed, 51 insertions, 47 deletions
diff --git a/configure.in b/configure.in index dc5f2812..896912bc 100644 --- a/configure.in +++ b/configure.in @@ -410,7 +410,7 @@ fi AC_PATH_PROG(PATH_TO_PS,ps) dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND -if [ps -weo 'stat comm vsz rss user uid ppid args' 2>/dev/null | egrep -i "^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+" >/dev/null] +if ps -weo 'stat comm vsz rss user uid ppid args' 2>/dev/null | egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output]) @@ -424,7 +424,7 @@ then AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[Format string for scanning ps output in check_rss]) echo " ps syntax... $PATH_TO_PS -weo 'stat comm vsz rss user ppid args'" dnl FreeBSD -elif [ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | egrep -i "^STAT +COMMAND +VSZ +RSS +UID +USER +PPID" >/dev/null] +elif ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | egrep -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PPID"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[]) @@ -438,7 +438,7 @@ then AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) echo " ps syntax... $PATH_TO_PS -Ao 'state command vsz rss'" dnl BSD-like mode in RH 6.1 -elif [ps waxno 'state comm vsz rss uid user ppid args' 2>/dev/null | egrep -i "^S +COMMAND +VSZ +RSS +UID +USER +PPID +[RGSCOMDNA]+" >/dev/null] +elif ps waxno 'state comm vsz rss uid user ppid args' 2>/dev/null | egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[]) @@ -454,7 +454,7 @@ then dnl SunOS 4.1.3: dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND dnl -elif [ps -laxnwww 2>/dev/null | egrep -i "^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND" >/dev/null] +elif ps -laxnwww 2>/dev/null | egrep -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS laxnwww",[]) @@ -471,7 +471,7 @@ dnl Debian Linux / procps v1.2.9: dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND dnl 100 0 1 0 0 0 776 76 c0131c8c S ffff 0:11 init [2] dnl -elif [ps laxnwww 2>/dev/null | egrep -i "^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND" >/dev/null] +elif ps laxnwww 2>/dev/null | egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS laxnwww",[]) @@ -485,7 +485,7 @@ then AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %d",[]) echo " ps syntax... $PATH_TO_PS laxnwww" dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs) -elif [ps -axo 'stat comm vsz rss user uid ppid args' 2>/dev/null | egrep -i "^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+" >/dev/null] +elif ps -axo 'stat comm vsz rss user uid ppid args' 2>/dev/null | egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output]) @@ -499,7 +499,7 @@ then AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[Format string for scanning ps output in check_rss]) echo " ps syntax... $PATH_TO_PS -axo 'stat comm vsz rss user ppid args'" dnl AIX 4.3.3 - needs verification. This works for Tru64 - needs %*[ +] in PS_FORMAT -elif [ps -ao 'stat comm vsz rss user uid ppid args' 2>/dev/null | egrep -i "^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+" >/dev/null] +elif ps -ao 'stat comm vsz rss user uid ppid args' 2>/dev/null | egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output]) @@ -512,7 +512,7 @@ then AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -ao 'rss comm'",[]) AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) echo " ps syntax... $PATH_TO_PS -ao 'stat comm vsz rss user ppid args'" -elif [ps -eo 's comm vsz rss user uid ppid args' 2>/dev/null | egrep -i "^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+" >/dev/null] +elif ps -eo 's comm vsz rss user uid ppid args' 2>/dev/null | egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output]) @@ -525,7 +525,7 @@ then AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -eo 'rss comm'",[]) AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) echo " ps syntax... $PATH_TO_PS -eo 's comm vsz rss user ppid args'" -elif [ps -Ao 's comm vsz rss uid user ppid args' 2>/dev/null | egrep -i "^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+" >/dev/null] +elif ps -Ao 's comm vsz rss uid user ppid args' 2>/dev/null | egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output]) @@ -538,7 +538,7 @@ then AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -Ao 'rss comm'",[]) AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) echo " ps syntax... $PATH_TO_PS -Ao 's comm vsz rss'" -elif [ps -Ao 'status comm vsz rss uid user ppid args' 2>/dev/null | egrep -i "^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+" >/dev/null] +elif ps -Ao 'status comm vsz rss uid user ppid args' 2>/dev/null | egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos]) @@ -551,7 +551,7 @@ then AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -Ao 'rss comm'",[]) AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) echo " ps syntax... $PATH_TO_PS -Ao 'status comm vsz rss'" -elif [ps -Ao 'state comm vsz rss uid user ppid args' 2>/dev/null | egrep -i "^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+" >/dev/null] +elif ps -Ao 'state comm vsz rss uid user ppid args' 2>/dev/null | egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos]) @@ -565,7 +565,7 @@ then AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) echo " ps syntax... $PATH_TO_PS -Ao 'state comm vsz rss'" dnl wonder who takes state instead of stat -elif [ps -ao 'state command vsz rss user ppid args' 2>/dev/null | egrep -i "^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+" >/dev/null] +elif ps -ao 'state command vsz rss user ppid args' 2>/dev/null | egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[]) @@ -579,7 +579,7 @@ then AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) echo " ps syntax... $PATH_TO_PS -ao 'state command vsz rss'" dnl IRIX 53 -elif [ps -el 2>/dev/null | egrep -i "^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null] +elif ps -el 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog],[]) @@ -591,7 +591,7 @@ then AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %d",[]) echo " ps syntax... $PATH_TO_PS -el" dnl IRIX 63 -elif [ps -el 2>/dev/null | egrep -i "^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null] +elif ps -el 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog],[]) @@ -606,7 +606,7 @@ dnl dnl AIX 4.1: dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper -elif [ps -el 2>/dev/null | egrep -i "^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null] +elif ps -el 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog],[]) @@ -618,7 +618,7 @@ then AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %*s %*s %d",[]) echo " ps syntax... $PATH_TO_PS -el" dnl AIX? -elif [ps glaxen 2>/dev/null | egrep -i "^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND" >/dev/null] +elif ps glaxen 2>/dev/null | egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[&procuid,&procppid,procstat,&pos,procprog],[]) @@ -633,7 +633,7 @@ dnl MacOSX / Darwin dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT dnl STAT VSZ RSS UID USER PPID UCOMM COMMAND dnl Ss 1308 272 0 root 0 init /sbin/init -elif [ps waxo 'state vsz rss uid user ppid ucomm command' 2>/dev/null | egrep -i "^STAT +VSZ +RSS +UID +USER +PPID +UCOMM +COMMAND" >/dev/null] +elif ps waxo 'state vsz rss uid user ppid ucomm command' 2>/dev/null | egrep -i ["^STAT +VSZ +RSS +UID +USER +PPID +UCOMM +COMMAND"] >/dev/null then AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[]) @@ -646,6 +646,19 @@ then AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS waxco 'rss command'",[]) AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[]) echo " ps syntax... $PATH_TO_PS waxo 'state vsz rss command'" +dnl UnixWare +elif ps -Al 2>/dev/null | egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null +then + AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf]) + AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog],[]) + AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -Al",[]) + AC_DEFINE_UNQUOTED(PS_FORMAT,"%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s",[Format string for scanning ps output in check_procs]) + if ps -Ao 'vsz comm' 2>/dev/null | egrep -i ["^ *VSZ +COMMAND"] >/dev/null + then + AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -Ao 'vsz comm'",[]) + AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%*s %d",[]) + fi + echo " ps syntax... $PATH_TO_PS -Al" else echo "** Unable to find usable ps syntax" fi @@ -654,25 +667,25 @@ AC_ARG_WITH(df_command,--with-df-command=<syntax> sets syntax for df,DF_COMMAND= if test -n "$DF_COMMAND" then AC_DEFINE_UNQUOTED(DF_COMMAND,"$DF_COMMAND",[path and args for df command]) -elif [df -Pk 2>/dev/null | egrep -i "^(/dev/|[a-zA-Z]:)[a-z0-9/\\]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/\\]*" >/dev/null] +elif df -Pk 2>/dev/null | egrep -i ["^(/dev/|[a-zA-Z]:)[a-z0-9/\\]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/\\]*"] >/dev/null then AC_PATH_PROG(PATH_TO_DF,df) - AC_MSG_RESULT(" df syntax... $PATH_TO_DF -Pk") + AC_MSG_RESULT([ df syntax... $PATH_TO_DF -Pk]) AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF -Pk",[path and args for df command]) -elif [df -k 2>/dev/null | egrep -i "^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*" >/dev/null] +elif df -k 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null then AC_PATH_PROG(PATH_TO_DF,df) - AC_MSG_RESULT(" df syntax... $PATH_TO_DF -k") + AC_MSG_RESULT([ df syntax... $PATH_TO_DF -k]) AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF -k",[path and args for df command]) -elif [df 2>/dev/null | egrep -i "^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*" >/dev/null] +elif df 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null then AC_PATH_PROG(PATH_TO_DF,df) - AC_MSG_RESULT(" df syntax... $PATH_TO_DF") + AC_MSG_RESULT([ df syntax... $PATH_TO_DF]) AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF",[path and args for df command]) -elif [bdf 2>/dev/null | egrep -i "^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*" >/dev/null] +elif bdf 2>/dev/null | egrep -i ["^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*"] >/dev/null then AC_PATH_PROG(PATH_TO_DF,bdf) - AC_MSG_RESULT(" df syntax... $PATH_TO_DF") + AC_MSG_RESULT([ df syntax... $PATH_TO_DF]) AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF",[path and args for df command]) else AC_MSG_WARN("unable to find usable df syntax") @@ -688,43 +701,43 @@ then then AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host]) fi -elif [ "z$ac_cv_uname_s" == "zUnixWare" && ping -n -s 127.0.0.1 56 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] +elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && ping -n -s 127.0.0.1 56 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null then PING_COMMAND="$PATH_TO_PING -n -U -c %d %s" AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host]) echo " ping syntax... $PATH_TO_PING -n -U -c <count> <host>" -elif [ping -n -U -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] +elif ping -n -U -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null then PING_COMMAND="$PATH_TO_PING -n -U -c %d %s" AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host]) echo " ping syntax... $PATH_TO_PING -n -U -c <count> <host>" -elif [ping -n -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] +elif ping -n -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null then PING_COMMAND="$PATH_TO_PING -n -c %d %s" AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host]) echo " ping syntax... $PATH_TO_PING -n -c <count> <host>" -elif [ping -n 127.0.0.1 -c 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] +elif ping -n 127.0.0.1 -c 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null then PING_COMMAND="$PATH_TO_PING -n %s -c %d" echo " ping syntax... $PATH_TO_PING -n <host> -c <count>" -elif [ping 127.0.0.1 -n 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] +elif ping 127.0.0.1 -n 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null then PING_COMMAND="$PATH_TO_PING %s -n %d" echo " ping syntax... $PATH_TO_PING <host> -n <count>" -elif [ping -n -s 127.0.0.1 56 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] +elif ping -n -s 127.0.0.1 56 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null then PING_COMMAND="$PATH_TO_PING -n -s %s 56 %d" echo " ping syntax... $PATH_TO_PING -n -s <host> 56 <count>" -elif [ping -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] +elif ping -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null then PING_COMMAND="$PATH_TO_PING -n -h %s -s 56 -c %d" echo " ping syntax... $PATH_TO_PING -n -h <host> -s 56 -c <count>" -elif [ping -n -s 56 -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] +elif ping -n -s 56 -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null then PING_COMMAND="$PATH_TO_PING -n -s 56 -c %d %s" AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host]) echo " ping syntax... $PATH_TO_PING -n -s 56 -c <count> <host>" -elif [ping -n -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null] +elif ping -n -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip|^rtt" >/dev/null then PING_COMMAND="$PATH_TO_PING -n -c %d %s" AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND",[Define if packet count must precede host]) @@ -737,32 +750,23 @@ AC_DEFINE_UNQUOTED(PING_COMMAND,"$PING_COMMAND",[path and args for ping command] AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup) if test -n "$ac_cv_path_PATH_TO_NSLOOKUP" then - AC_MSG_CHECKING("nslookup syntax") - if [nslookup -sil 127.0.0.1 2>&1 | grep "Invalid option: sil" >/dev/null] + if nslookup -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null then - AC_MSG_RESULT("$PATH_TO_NSLOOKUP") + AC_MSG_RESULT([ nslookup syntax... $PATH_TO_NSLOOKUP]) AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$PATH_TO_NSLOOKUP",[path and args for nslookup]) else - AC_MSG_RESULT("$PATH_TO_NSLOOKUP -sil") + AC_MSG_RESULT([ nslookup syntax... $PATH_TO_NSLOOKUP -sil]) AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$PATH_TO_NSLOOKUP -sil",[path and args for nslookup]) fi EXTRAS="$EXTRAS check_dns" else - AC_MSG_WARN("nslookup command not found") + AC_MSG_WARN([nslookup command not found]) fi AC_PATH_PROG(PATH_TO_HOST,host) if test -n "$ac_cv_path_PATH_TO_HOST" then - AC_MSG_CHECKING("host syntax") - if [host 127.0.0.1 2>&1 | grep -v "ommand not found" > /dev/null] - then - AC_MSG_RESULT("$PATH_TO_HOST") - AC_DEFINE_UNQUOTED(HOST_COMMAND,"$PATH_TO_HOST",[path to host binary]) - fi EXTRAS="$EXTRAS check_dns" -else - AC_MSG_WARN("host command not found") fi AC_PATH_PROG(PATH_TO_UPTIME,uptime) |