Ignore:
Timestamp:
Aug 31, 2006, 9:25:02 PM (18 years ago)
Author:
rainer
Message:

Fix for exit status if database load fails; fix for problem with GrowingLogFiles if signed database is used; better support for *BSD init script installation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samhain-install.sh.in

    r1 r59  
    672672       realname="$user"
    673673       case "$platform" in
    674            FreeBSD/* | NetBSD/* )
     674           FreeBSD/* | NetBSD/* | OpenBSD/* )
    675675              file=/etc/master.passwd
    676676              entry="${user}:*:${uid}:${gid}::0:0:${realname}:${home}:${shell}"
     
    785785        ;;
    786786
     787    OpenBSD/*)
     788        test -z "$verbose" || echo "  OpenBSD system detected"
     789        grep '^## begin @install_name@' /etc/rc.local >/dev/null 2>&1
     790        if [ $? -eq 0 ]; then
     791            RCLOCALTMP=`mktemp /etc/rc.local.XXXXXXXXXX` || exit 1
     792            sed "/^## begin @install_name@/,/^## end @install_name@/d" /etc/rc.local >$RCLOCALTMP || exit 1
     793            cat $RCLOCALTMP >/etc/rc.local || exit 1
     794            rm -f $RCLOCALTMP || exit 1
     795            if test x"$act" = xuboot; then
     796                echo "  uninstalling from /etc/rc.local completed"
     797            fi
     798        fi
     799        if test x"$act" = xboot; then
     800            echo "## begin @install_name@"          >>/etc/rc.local || exit 1
     801            echo "if [ -x @sbindir@/@install_name@ ]; then" >>/etc/rc.local || exit 1
     802            echo "  @sbindir@/@install_name@ start" >>/etc/rc.local || exit 1
     803            echo "fi"                               >>/etc/rc.local || exit 1
     804            echo "## end @install_name@"            >>/etc/rc.local || exit 1
     805            echo "  installing to /etc/rc.local completed"
     806        fi
     807        exit 0
     808        ;;
     809
     810    NetBSD/*)
     811        test -z "$verbose" || echo "  NetBSD system detected"
     812        if test -f /etc/rc.subr; then
     813            DVER="FreeBSD"
     814            rc_main=${DESTDIR}/etc/rc.d
     815            rc_dirz=
     816            rc_inst="chmod 755 /etc/rc.d/@install_name@"
     817            rc_uinst="rm -f /etc/rc.d/@install_name@"
     818        else
     819            echo "${0}: unsupported platform ${platform} (too old)"
     820            exit 1
     821        fi
     822        ;;
     823
    787824    FreeBSD/* )
    788         DVER="FreeBSD"
    789825        test -z "$verbose" || echo "  FreeBSD system detected"
    790         rc_main=${DESTDIR}/usr/local/etc/rc.d
    791         rc_dirz=
    792         rc_inst="mv /usr/local/etc/rc.d/@install_name@ /usr/local/etc/rc.d/@install_name@.sh &&  chmod 755 /usr/local/etc/rc.d/@install_name@.sh"
    793         rc_uinst="rm -f /usr/local/etc/rc.d/@install_name@.sh; echo You may want to remove ${rc_main} from local_startup in /etc/rc.conf; echo if it is empty"
     826        if test -f /etc/rc.subr; then
     827            DVER="FreeBSD"
     828            rc_main=${DESTDIR}/etc/rc.d
     829            rc_dirz=
     830            rc_inst="chmod 755 /etc/rc.d/@install_name@"
     831            rc_uinst="rm -f /etc/rc.d/@install_name@"
     832        else
     833            DVER="Solaris"
     834            rc_main=${DESTDIR}/usr/local/etc/rc.d
     835            rc_dirz=
     836            rc_inst="mv /usr/local/etc/rc.d/@install_name@ /usr/local/etc/rc.d/@install_name@.sh && chmod 755 /usr/local/etc/rc.d/@install_name@.sh"
     837            rc_uinst="rm -f /usr/local/etc/rc.d/@install_name@.sh"
     838        fi
    794839        if test x"$act" = xboot
    795840        then
     
    797842                test x"$act" = xboot && mkdir ${rc_main}
    798843            fi
     844            if test "x$DVER" = "xSolaris"; then
    799845            (   . /etc/defaults/rc.conf
    800846                . /etc/rc.conf
     
    814860                fi
    815861            )
    816        fi
     862            fi
     863        fi
    817864        ;;
     865
    818866    SunOS/5.* )
    819867        DVER="Solaris"
     868        DVER_REAL="Solaris"
    820869        test -z "$verbose" || echo "  Solaris system detected"
    821870        rc_dirz=
     
    824873        rc_uinst="rm -f ${DESTDIR}/etc/init.d/@install_name@; rm -f ${DESTDIR}/etc/rc0.d/K10@install_name@; rm -f ${DESTDIR}/etc/rc1.d/K10@install_name@; rm -f ${DESTDIR}/etc/rc3.d/S99@install_name@"
    825874        ;;
     875
    826876    Linux/*)
    827877        rlv="2 3 4 5"
     
    10051055                    ${mkinstalldirs} ${rc_main}
    10061056                    #
    1007                     if test x"$DVER" = xSolaris; then
     1057                    if test x"${DVER_REAL}" = xSolaris; then
    10081058                        ${mkinstalldirs} ${DESTDIR}/etc/rc0.d
    10091059                        ${mkinstalldirs} ${DESTDIR}/etc/rc1.d
Note: See TracChangeset for help on using the changeset viewer.