Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 May 1998 13:35:50 -0500
From:      "Scot W. Hetzel" <hetzels@westbend.net>
To:        "FreeBSD-Current" <FreeBSD-Current@FreeBSD.ORG>
Subject:   Periodic file for CVSup
Message-ID:  <013501bd79e6$f601e440$c3e0d9cf@admin.westbend.net>

next in thread | raw e-mail | index | archive | help
I just created the script bellow that can be used update a server on a
daily, weekly, or monthly basis.  Depending on where it is installed into
the /etc/periodic directory tree.

To determine the SUP program, SUP flags, and SUP file, the script obtains
these values from the make.conf file.

Any suggestions for improvements.

Scot W. Hetzel

NOTE:  The make.conf file has to be parsed, as using ". /etc/make.conf" to
bring the values in doesn't work.

---- 998.cvsup ----
#!/bin/sh -

if [ -f /etc/make.conf ] ;
then
   SUP_UPDATE=`grep SUP_UPDATE= /etc/make.conf | grep -v "#SUP_UPDATE=" |
awk '{print $2}'`

   if [ "${SUP_UPDATE}" = "yes" ] ;
   then

   #Get the variables SUP, SUPFLAGS, SUPFILE from the make.conf file
   SUP=`grep SUP= /etc/make.conf | grep -v "#SUP=" | awk '{print $2}'`
   SUPFLAGS=`grep SUPFLAGS= /etc/make.conf | grep -v "#SUPFLAGS=" | awk -F=
'{print $2}'`
   SUPFILE=`grep SUPFILE= /etc/make.conf | grep -v "#SUPFILE=" | awk '{print
$2}'`
   #Check type of update we are performing
   case `basename \`pwd\`` in
           daily) PERIOD="Daily";;
          weekly) PERIOD="Weekly";;
         monthly) PERIOD="Monthly";;
   esac

   #Are we doing a CVSup or a Sup Update
   case `basename ${SUP}` in
        cvsup) CVSUP="CVSup";;
          sup) CVSUP="Sup";;
   esac

   echo ""
   echo "${PERIOD} ${CVSUP} Update:"

   ${SUP} ${SUPFLAGS} ${SUPFILE}
   fi
fi
---- 998.cvsup ----


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?013501bd79e6$f601e440$c3e0d9cf>