home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #******************************************************************************
- #
- # Copyright (C) 1995 The Santa Cruz Operation, Inc.
- # All Rights Reserved.
- #
- # The information in this file is provided for the exclusive use of
- # the licensees of The Santa Cruz Operation, Inc. Such users have the
- # right to use, modify, and incorporate this code into other products
- # for purposes authorized by the license agreement provided they include
- # this notice and the associated copyright notice with any such product.
- # The information in this file is provided "AS IS" without warranty.
- #
- #===============================================================================
- buildDate="3.5.2 - Mon Jan 27 13:22:20 1997"
-
- # This script was built from shell library
- # $Id: install.shlib,v 10.16.2.3 1997/02/11 19:58:19 tobyd Exp $
-
- GLOB_VISION_FILE=/etc/vision.conf
- VISION_FILE=/etc/vision.conf
-
- hostname="`uname -n | sed 's@^\([^\.]*\).*@\1@'`"
-
- N=""
- C=""
- if echo -n | grep n > /dev/null
- then
- C="\c"
- else
- N="-n"
- fi
- _ss_headlines="--------------------------------------------------------------------------"
-
-
- INST_PRODUCT=VISIONFS
- INST_RCFILE=S90visionfs
- INST_RCSTRING="##VisionFS##"
-
- # set up message catalog
- . /var/sadm/pkg/${PKGINST}/install/${PKGINST}/setup
-
- OK=0
- FAIL=1
-
- ccsError()
- {
- echo "$0: " $* 1>&2
- }
-
- ccsWarning()
- {
- echo "$0: " $* 1>&2
- }
-
- # work out the rctype
- a_rccurrun=""
- a_rcinstrun=""
- if [ -d /etc/rc2.d -o -d /etc/rc3.d ]
- then
- a_rctype="svr4"
- a_rcfile="/etc"
- elif [ -d /sbin/rc2.d -o -d /sbin/rc3.d ]
- then
- a_rctype="sbin"
- a_rcfile="/sbin"
- elif [ -f /etc/rc.local ]
- then
- a_rctype="local"
- a_rcfile="/etc/rc.local"
- elif [ -f /etc/rc.d/rc.local ]
- then
- a_rctype="rcd"
- a_rcfile="/etc/rc.d/rc.local"
- elif [ -f /etc/rc.nfs ]
- then
- a_rctype="nfs"
- a_rcfile="/etc/rc.nfs"
- elif [ -f /etc/rc ]
- then
- a_rctype="basic"
- a_rcfile="/etc/rc"
- else
- a_rctype="unknown"
- a_rcfile=""
- fi
-
- if [ "$a_rctype" = "svr4" -o "$a_rctype" = "sbin" ]; then
- a_rccurrun=`who -r | awk '{print $3;}'`
- if [ "a_rctype" = "svr4" ]; then
- _rcbase=/etc/rc
- else
- _rcbase=/sbin/rc
- fi
- for _i in S 1 2 3 4
- do
- if [ -f $_rcbase$_i.d/$INST_RCFILE ]
- then
- a_rcinstrun=$_i
- break
- fi
- done
- a_rcfile=$a_rcfile/rc$a_rccurrun.d/$INST_RCFILE
- fi
-
-
- # remove RC file
- # set the defaults
- _delete=false
- _files="dummy"
-
- # create the list of files to check
- case "$a_rctype" in
- "svr4")
- _delete=true
- for _i in S 1 2 3 4
- do
- if [ -f /etc/rc$_i.d/$INST_RCFILE ]
- then
- _files="$_files /etc/rc$_i.d/$INST_RCFILE"
- fi
- done
- ;;
- "sbin")
- _delete=true
- for _i in S 1 2 3 4
- do
- if [ -f /sbin/rc$_i.d/S90visionfs ]
- then
- _files="$_files /sbin/rc$_i.d/S90visionfs" # !!!visionfs???
- fi
- done
- ;;
- "local")
- _files="$_files /etc/rc.local"
- ;;
- "rcd")
- _files="$_files /etc/rc.d/rc.local"
- ;;
- "nfs")
- _files="$_files /etc/rc.nfs"
- ;;
- "basic")
- _files="$_files /etc/rc"
- ;;
- esac
-
- # either delete the files, or substitute them
- if [ "$_delete" = "true" ]
- then
- for _i in $_files
- do
- if [ "$_i" = "dummy" ]
- then
- continue
- fi
- rm -f $_i
- done
- else
- for _i in $_files
- do
- if [ "$_i" = "dummy" ]
- then
- continue
- fi
-
- # delete everything between the start and stop markers
- echo "BEGIN {" > $_i.awk
- echo " doprint=1;" >> $_i.awk
- echo "}" >> $_i.awk
- echo "\$1 == \"$INST_RCSTRING\" {" >> $_i.awk
- echo " if (\$2 == \"start\") {" >> $_i.awk
- echo " doprint = 0;" >> $_i.awk
- echo " } else {" >> $_i.awk
- echo " doprint = 1;" >> $_i.awk
- echo " continue;" >> $_i.awk
- echo " }" >> $_i.awk
- echo "}" >> $_i.awk
- echo "{" >> $_i.awk
- echo " if (doprint == 1) {" >> $_i.awk
- echo " print" >> $_i.awk
- echo " }" >> $_i.awk
- echo "}" >> $_i.awk
-
- # run the newly created awk script on the file
- if [ -f $_i.awk ]
- then
- cp -p $_i $_i.tmp1 #for perms
- awk -f $_i.awk $_i > $_i.tmp1
- rm -f $_i.awk
- fi
-
- # move the new copy over the old
- if [ -f $_i.tmp1 ]
- then
- cp -p $_i.tmp1 $_i
- rm -f $_i.tmp1
- fi
- done
- fi
-
- crontab -l 2>/dev/null | grep -v "/visionfs checkpoint" | crontab 2>/dev/null
-
-
-
- exit $OK
-
-