#!/bin/ksh ############################################################################### # $Id: up2date_download_all,v 1.1.1.1 2005/09/06 14:04:40 petri Exp $ # Project: ESRF/Linux # Description: Get list of all available, up-to-date packages for this # server and download them on up2date-utility's spool directory # (usually /var/spool/up2date) # # This script is intended to be run by root, overnight, with # nohup-utility. # # Author(s): Petri Makijarvi # European Synchrotron Radiation Facility, # Grenoble, France # # Original: August 2005 # # License: GNU General Public License, version 2 ############################################################################### # # This script can be executed only by root # if [ $(whoami) != "root" ];then echo "You must be root" exit 1 fi if [ ! -d /var/spool/up2date ]; then echo "Did not find /var/spool/up2date. Is this machine registered?" exit 1 fi # # Get list of all packages # up2date-nox --showall >/tmp/showall.txt # # Clean the up2date utility spool # # unalias rm # rm /var/spool/up2date/* # # Start fetching the packages, one by one. # pkgnames=`cat /tmp/showall.txt` for pkg in $pkgnames do up2date-nox --download --get ${pkg} sleep 5 done # echo "" echo "up2date_download_all: done." exit 0 # end of up2date_download_all