Combined port and index update into one action to guarantee sequencing.
Pointed ports and stable CVSUPs to different hosts.
Changed command execution to run in background.
1 parent 095d8e1 commit 454f826e9175696b4eb57e8314f6e2a868cd70c8
@toor toor authored on 13 Feb 2006
Showing 1 changed file
View
49
sysupd
#!/bin/sh
# Update Various System Files, Ports, etc.
# Copyright (c) 2006, TundraWare Inc, Des Plaines, IL USA
# All Rights Reserved
# $Id: sysupd,v 1.101 2006/02/10 06:39:59 root Exp $
 
 
#####
# The CVSHOST To Use
#####
 
CVSHOST=cvsup5.freebsd.org
# $Id: sysupd,v 1.102 2006/02/13 17:10:37 toor Exp $
 
 
#####
# Where To Put The Various Log Files Generated Here
#####
 
DIRCVS=/bku/LOGS
DIRINDEX=/bku/LOGS
DIRMIRROR=/bku/LOGS
DIRNESSUS=/bku/LOGS
 
 
#####
# List Of Sets To Process By Default
# Always Do The Ports Index Rebuild *After* The Ports CVSUP
#####
 
DEFAULTSETS='mirror nessus ports stable index'
#DEFAULTSETS='mirror nessus ports stable'
DEFAULTSETS='mirror ports stable'
 
 
# ---------------- Support Functions ---------------- #
 
runupd()
{
log=$2/$1.log
timestamp $log
touch $2/.$1-begin
eval $3 2>&1 >> $log
touch $2/.$1-end
touch $2/.$1-begin && eval $3 2>&1 >> $log && touch $2/.$1-end &
}
 
# End of 'runupd()'
 
case $SET
in
 
###
# Rebuild Ports Index
###
 
index)
runupd $SET $DIRINDEX "cd /usr/ports && make index"
;;
 
 
###
# Update Mirrored FreeBSD Files
###
 
###
# CVSUP Updates
###
 
ports|stable)
runupd $SET $DIRCVS "/usr/local/bin/cvsup -h $CVSHOST -g /root/cvsup/$SET-supfile"
ports)
runupd $SET $DIRCVS "/usr/local/bin/cvsup -h cvsup4.freebsd.org -g /root/cvsup/$SET-supfile && cd /usr/ports && make index"
;;
 
stable)
runupd $SET $DIRCVS "/usr/local/bin/cvsup -h cvsup5.freebsd.org -g /root/cvsup/$SET-supfile"
;;
 
esac