[1] | 1 | #! /bin/sh
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 | # The following two are the ANSI sequences for start and end embolden
|
---|
| 5 | case $TERM in
|
---|
| 6 | vt*|ansi*|con*|xterm*|linux*|screen*)
|
---|
| 7 | S=[1m
|
---|
| 8 | E=[m
|
---|
| 9 | ;;
|
---|
| 10 | *)
|
---|
| 11 | S=
|
---|
| 12 | E=
|
---|
| 13 | ;;
|
---|
| 14 | esac
|
---|
| 15 |
|
---|
| 16 | PW_DIR=`pwd`
|
---|
| 17 |
|
---|
| 18 | if test x$UID != x; then
|
---|
| 19 | TRUST="--with-trusted=0,2,$UID"
|
---|
| 20 | else
|
---|
| 21 | TRUST="--with-trusted=0,2"
|
---|
| 22 | fi
|
---|
| 23 |
|
---|
| 24 | echo; echo "${S}__ STARTING TEST TIMESERVER OPTION __${E}"; echo;
|
---|
| 25 | echo Working directory: $PW_DIR
|
---|
| 26 |
|
---|
| 27 | MAKE=`which gmake`
|
---|
| 28 | if test "x$?" = x1 ; then
|
---|
| 29 | MAKE="make -s"
|
---|
| 30 | else
|
---|
| 31 | MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"`
|
---|
| 32 | if test "x$MAKE" = x; then
|
---|
| 33 | MAKE="make -s"
|
---|
| 34 | elif test "x$MAKE" = xno; then
|
---|
| 35 | MAKE="make -s"
|
---|
| 36 | else
|
---|
| 37 | if test "x$MAKE" = "xwhich:"; then
|
---|
| 38 | MAKE="make -s"
|
---|
| 39 | else
|
---|
| 40 | MAKE="gmake -s"
|
---|
| 41 | gmake -v >/dev/null 2>&1 || MAKE="make -s"
|
---|
| 42 | fi
|
---|
| 43 | fi
|
---|
| 44 | fi
|
---|
| 45 |
|
---|
| 46 | echo MAKE is $MAKE
|
---|
| 47 | echo
|
---|
| 48 |
|
---|
| 49 |
|
---|
| 50 | testtime0 ()
|
---|
| 51 | {
|
---|
| 52 | #
|
---|
| 53 | # standalone compilation
|
---|
| 54 | #
|
---|
| 55 | echo "${S}Building standalone agent w/timeserver${E}"; echo;
|
---|
| 56 | #
|
---|
| 57 | if test -r "Makefile"; then
|
---|
| 58 | $MAKE distclean
|
---|
| 59 | fi
|
---|
| 60 | #
|
---|
| 61 | ${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/test/testrc_1 --with-timeserver=www.foo.bar --with-alttimeserver=127.0.0.1 --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file
|
---|
| 62 | #
|
---|
| 63 | if test x$? = x0; then
|
---|
| 64 | echo "configure completed, exit status 0"; echo;
|
---|
| 65 | $MAKE > /dev/null
|
---|
| 66 | echo "$MAKE completed, exit status $?"; echo;
|
---|
| 67 | else
|
---|
| 68 | echo "ERROR: configure failed"; echo;
|
---|
| 69 | fi
|
---|
| 70 |
|
---|
| 71 |
|
---|
| 72 | rm -f $PW_DIR/.samhain_file $PW_DIR/.samhain_log $PW_DIR/.samhain_lock
|
---|
| 73 |
|
---|
| 74 | ./samhain -t init
|
---|
| 75 |
|
---|
| 76 | if test x$? = x0; then
|
---|
| 77 | echo
|
---|
| 78 | echo "${S}init completed${E}"
|
---|
| 79 | echo
|
---|
| 80 | ./samhain -t check
|
---|
| 81 | if test x$? = x0; then
|
---|
| 82 | echo "${S}check completed${E}"
|
---|
| 83 | else
|
---|
| 84 | echo "${S}ERROR:${E} -- check -- failed, exit status $?"
|
---|
| 85 | echo
|
---|
| 86 | exit
|
---|
| 87 | fi
|
---|
| 88 | else
|
---|
| 89 | echo "${S}ERROR:${E} -- init -- failed, exit status $?"; echo;
|
---|
| 90 | exit
|
---|
| 91 | fi
|
---|
| 92 |
|
---|
| 93 | }
|
---|
| 94 |
|
---|
| 95 |
|
---|
| 96 |
|
---|
| 97 | testtime0
|
---|
| 98 |
|
---|
| 99 |
|
---|
| 100 | echo; echo "${S}__ END TEST TIMESERVER OPTION __${E}"; echo;
|
---|
| 101 |
|
---|
| 102 | exit
|
---|
| 103 |
|
---|