From: system@alchemy.chem.utoronto.ca (System Admin (Mike Peterson))
Subject: Re: Post OS installations: what do YOU do?
Organization: University of Toronto Chemistry Department
Distribution: fj
Date: Mon, 17 Aug 1992 17:10:55 GMT
Return-Path: <apollo-list-errors@srvr1.engin.umich.edu>

In article <1992Aug15.222958.27644@edsi.plexus.COM> chuck@edsi.plexus.COM (Chuck Tomasi) writes:
>Over the last couple of years I have evolved a script to take care of a
>machine once the OS and patches have been installed.  It started out
>with a few site specific links and has grown to include patches to rc
>files, extreme conditional checking, and lots more.  I'm curious to know
>how many other sites have a post_os (or some other named) script and
>what it includes.  Would you be willing to post it here (commented of
>course to help readability) or a synopsis of what you do?

This one also started the same way, and is augmented by ~20 pages
of nroff'ed notes on stuff I must do manually after an install.
(I am willing to post them too if anyone wants them).
I also have a similar script to this for our HP-UX systems,
plus scripts that do automatic sysadmin every hour, day and month
for both Domain/OS and HP-UX.

#! /bin/ksh
#
# Usage: Localstuff             - create any local files/links.
#	 Localstuff clean	- remove and recreate all local files/links.
#
host=`hostname`
clean=$1
#
umask 22
#
# Set master news node.
#
masternews=alchemy
#
if [ "$clean" = "clean" ]; then
   echo "Removing old files/links/directories, and relinking."
   echo " "
fi
#
# Create extra /dev files only if they don't exist:
#	/dev/wn1a	(only on //plumbum)
#	/dev/rwn1a	(only on //plumbum)
#	/dev/pty[pqrs]*	(only on //plumbum)
#	/dev/tty[pqrs]*	(only on //plumbum)
# Link /dev/rmt8 and /dev/rmt12 to /dev/ws_rmt8 and /dev/ws_rmt12
# respectively (on //plumbum only).
#
if [ $host = plumbum ]; then
   if [ -f /dev/wn1a ]; then
      echo "/dev/wn1a already exists - do nothing."
   else
      /etc/mknod /dev/wn1a b 0 17
      chmod 666 /dev/wn1a
      echo "/dev/wn1a created - see /etc/rc for the mount command."
   fi
   if [ -f /dev/rwn1a ]; then
      echo "/dev/rwn1a already exists - do nothing."
   else
      /etc/mknod /dev/rwn1a c 0 17
      chmod 666 /dev/rwn1a
      echo "/dev/rwn1a created."
   fi
   if [ -f /dev/ptyp0 ]; then
      echo "Some pty's already exist - do nothing."
   else
      /etc/crpty 32
      echo "/dev/pty[pqrs]* created."
   fi
   if [ "$clean" = "clean" ]; then
      rm -f /dev/rmt8 ; echo "/dev/rmt8 removed."
      rm -f /dev/rmt12 ; echo "/dev/rmt12 removed."
   fi
   test -L /dev/rmt8
   if [ "$?" = 0 ]; then
      echo "/dev/rmt8 is already a link - do nothing."
   else
      ln -s ws_rmt8 /dev/rmt8
      echo "/dev/rmt8 linked to /dev/ws_rmt8."
   fi
   test -L /dev/rmt12
   if [ "$?" = 0 ]; then
      echo "/dev/rmt12 is already a link - do nothing."
   else
      ln -s ws_rmt12 /dev/rmt12
      echo "/dev/rmt12 linked to /dev/ws_rmt12."
   fi
fi
#
# Create NFS mount points for systems with multiple file systems
# (if they don't exist).
# Create reference directories if they don't exist; note that these
# directories will contain links to the NFS mount point directories.
# Do the link for the root (/) file system.
#
for nfshost in alchemy argentum gatto solaia taurasi tikva yaffa
do
   f1=/nfs
   if [ -d $f1 ]; then
      echo "$f1 already exists - do nothing."
   else
      mkdir $f1
      echo "$f1 created."
   fi
   f1=/nfs/$nfshost
   if [ -d $f1 ]; then
      echo "$f1 already exists - do nothing."
   else
      mkdir $f1
      echo "$f1 created."
   fi
   f1=/$nfshost
   if [ -d $f1 ]; then
      echo "$f1 already exists - do nothing."
   else
      mkdir $f1
      echo "$f1 created."
   fi
   f1=/nfs/$nfshost/root
   f2=/$nfshost/root
   if [ "$clean" = "clean" ]; then
      rm -f $f2 ; echo "$f2 removed."
   fi
   test -L $f2
   if [ "$?" = 0 ]; then
      echo "$f2 already is a link - do nothing."
   else
      rm -f $f2 ; echo "$f2 removed."
      ln -s $f1 $f2
      echo "$f2 linked to $f1."
   fi
done
#
# Do NFS root (/) mount point link for systems with single file systems
# (if they don't exist).
#
#for nfshost in
#do
#   f1=/nfs
#   if [ -d $f1 ]; then
#      echo "$f1 already exists - do nothing."
#   else
#      mkdir $f1
#      echo "$f1 created."
#   fi
#   f1=/nfs/$nfshost
#   f2=/$nfshost
#   if [ "$clean" = "clean" ]; then
#      rm -f $f2 ; echo "$f2 removed."
#   fi
#   test -L $f2
#   if [ "$?" = 0 ]; then
#      echo "$f2 already is a link - do nothing."
#   else
#      rm -f $f2 ; echo "$f2 removed."
#      ln -s $f1 $f2
#      echo "$f2 linked to $f1."
#   fi
#done
#
# Do extra links for host argentum (for /u1).
#
for filesys in u1
do
   f1=/nfs/argentum/$filesys
   f2=/argentum/$filesys
   if [ "$clean" = "clean" ]; then
      rm -f $f2 ; echo "$f2 removed."
   fi
   test -L $f2
      if [ "$?" = 0 ]; then
      echo "$f2 already is a link - do nothing."
   else
      rm -f $f2 ; echo "$f2 removed."
      ln -s $f1 $f2
      echo "$f2 linked to $f1."
   fi
done
#
# Do extra links for host gatto (for /usr).
#
for filesys in usr
do
   f1=/nfs/gatto/$filesys
   f2=/gatto/$filesys
   if [ "$clean" = "clean" ]; then
      rm -f $f2 ; echo "$f2 removed."
   fi
   test -L $f2
      if [ "$?" = 0 ]; then
      echo "$f2 already is a link - do nothing."
   else
      rm -f $f2 ; echo "$f2 removed."
      ln -s $f1 $f2
      echo "$f2 linked to $f1."
   fi
done
#
# Do extra links for host alchemy (for /u1 and /news).
#
for filesys in u1 news
do
   f1=/nfs/alchemy/$filesys
   f2=/alchemy/$filesys
   if [ "$clean" = "clean" ]; then
      rm -f $f2 ; echo "$f2 removed."
   fi
   test -L $f2
      if [ "$?" = 0 ]; then
      echo "$f2 already is a link - do nothing."
   else
      rm -f $f2 ; echo "$f2 removed."
      ln -s $f1 $f2
      echo "$f2 linked to $f1."
   fi
done
#
# Do extra links for host solaia (for /users).
#
for filesys in users
do
   f1=/nfs/solaia/$filesys
   f2=/solaia/$filesys
   if [ "$clean" = "clean" ]; then
      rm -f $f2 ; echo "$f2 removed."
   fi
   test -L $f2
      if [ "$?" = 0 ]; then
      echo "$f2 already is a link - do nothing."
   else
      rm -f $f2 ; echo "$f2 removed."
      ln -s $f1 $f2
      echo "$f2 linked to $f1."
   fi
done
#
# Do extra links for host taurasi (for /u1).
#
for filesys in u1
do
   f1=/nfs/taurasi/$filesys
   f2=/taurasi/$filesys
   if [ "$clean" = "clean" ]; then
      rm -f $f2 ; echo "$f2 removed."
   fi
   test -L $f2
      if [ "$?" = 0 ]; then
      echo "$f2 already is a link - do nothing."
   else
      rm -f $f2 ; echo "$f2 removed."
      ln -s $f1 $f2
      echo "$f2 linked to $f1."
   fi
done
#
# Do extra links for host tikva (for /u1 and /usr).
#
for filesys in u1 usr
do
   f1=/nfs/tikva/$filesys
   f2=/tikva/$filesys
   if [ "$clean" = "clean" ]; then
      rm -f $f2 ; echo "$f2 removed."
   fi
   test -L $f2
   if [ "$?" = 0 ]; then
      echo "$f2 already is a link - do nothing."
   else
      rm -f $f2 ; echo "$f2 removed."
      ln -s $f1 $f2
      echo "$f2 linked to $f1."
   fi
done
#
# Create administrative files only if they don't exist:
#	/usr/adm/imagen_acct/imagen
#	/usr/spool/lpd/imagen/log
#	/usr/adm/wtmp
#
if [ -f /usr/adm/imagen_acct/imagen ]; then
   echo "/usr/adm/imagen_acct/imagen already exists - do nothing."
else
   if [ ! -d /usr/adm/imagen_acct ]; then
      mkdir /usr/adm/imagen_acct
      chmod 755 /usr/adm/imagen_acct
      echo "/usr/adm/imagen_acct directory created."
   fi
   touch /usr/adm/imagen_acct/imagen
   chmod 664 /usr/adm/imagen_acct/imagen
   chown -R daemon.daemon /usr/adm/imagen_acct
   echo "/usr/adm/imagen_acct/imagen created."
fi
if [ -f /usr/spool/lpd/imagen/log ]; then
   echo "/usr/spool/lpd/imagen/log already exists - do nothing."
else
   if [ ! -d /usr/spool/lpd/imagen ]; then
      mkdir /usr/spool/lpd/imagen
      chmod 755 /usr/spool/lpd/imagen
      echo "/usr/spool/lpd/imagen directory created."
   fi
   touch /usr/spool/lpd/imagen/log
   chmod 664 /usr/spool/lpd/imagen/log
   chown -R daemon.daemon /usr/spool/lpd/imagen
   echo "/usr/spool/lpd/imagen/log created."
fi
if [ -f /usr/adm/wtmp ]; then
   echo "/usr/adm/wtmp already exists - do nothing."
else
   touch /usr/adm/wtmp
   chmod 666 /usr/adm/wtmp
   echo "/usr/adm/wtmp created."
fi
#
# Make links for man pages.
# Link /usr/man/catl to /usr/local/man/catl on //plumbum, //todah,
# //aurum and //flatland.
# Link the man pages on //aqua to //plumbum/bsd4.3/usr/man and
# //plumbum/bsd4.3/usr/apollo/man respectively.
# Make links in /usr/local/man/catl to /usr/local/doc/*.out on //plumbum,
# //todah, //aurum and //flatland.
#
if [ $host = plumbum -o $host = todah -o $host = aurum -o $host = flatland ]; then
   if [ "$clean" = "clean" ]; then
      rm -f /bsd4.3/usr/man/catl ; echo "/bsd4.3/usr/man/catl removed."
   fi
   if [ -d /bsd4.3/usr/man/catl ]; then
      echo "/bsd4.3/usr/man/catl already exists - do nothing."
   else
      ln -s ../../../usr/local/man/catl /bsd4.3/usr/man/catl
      echo "/bsd4.3/usr/man/catl linked to /usr/local/man/catl."
   fi
   cwd=`pwd`
   cd /usr/local/doc
   for i in *.out
   do
      ibase=`basename $i .out`
      if [ "$clean" = "clean" ]; then
         rm -f /usr/local/man/catl/$ibase.l
         echo "/usr/local/man/catl/$ibase.l removed."
      fi
      if [ -f /bsd4.3/usr/man/catl/$ibase.l ]; then
         echo "/bsd4.3/usr/man/catl/$ibase.l already exists - do nothing."
      else
         ln -s /usr/local/doc/$i /usr/local/man/catl/$ibase.l
         echo "/usr/local/man/catl/$ibase.l linked to /usr/local/doc/$i."
      fi
   done
   cd $cwd
fi
if [ $host = aqua ]; then
   if [ "$clean" = "clean" ]; then
      rm -f /bsd4.3/usr/man ; echo "/bsd4.3/usr/man removed."
      rm -f /usr/apollo/man ; echo "/usr/apollo/man removed."
   fi
   if [ -d /bsd4.3/usr/man ]; then
      echo "/bsd4.3/usr/man already exists - do nothing."
   else
      ln -s //plumbum/bsd4.3/usr/man /bsd4.3/usr/man
      echo "/bsd4.3/usr/man linked to //plumbum/bsd4.3/usr/man."
   fi
   if [ -d /usr/apollo/man ]; then
      echo "/usr/apollo/man already exists - do nothing."
   else
      ln -s //plumbum/usr/apollo/man /usr/apollo/man
      echo "/usr/apollo/man linked to //plumbum/usr/apollo/man."
   fi
fi
#
# Make links for /usr/msgs on all nodes except //plumbum.
# Link the msgs directory to //plumbum.
# Make sure that /usr/msgs is a link to ../$(SYSTYPE)/usr/msgs.
#
if [ "$clean" = "clean" ]; then
   rm -fr /usr/msgs ; echo "/usr/msgs removed."
   rm -fr /bsd4.3/usr/msgs ; echo "/bsd4.3/usr/msgs removed."
fi
if [ -d /bsd4.3/usr/msgs ]; then
   echo "/bsd4.3/usr/msgs already exists - do nothing."
else
   ln -s /alchemy/root/usr/msgs /bsd4.3/usr/msgs
   echo "/bsd4.3/usr/msgs linked to /alchemy/root/usr/msgs."
fi
if [ -d /usr/msgs ]; then
      echo "/usr/msgs already exists - do nothing."
else
   ln -s '../$(SYSTYPE)/usr/msgs' /usr/msgs
   echo '/usr/msgs linked to ../$(SYSTYPE)/usr/msgs.'
fi
#
# Make links between Apollo-supplied /usr/... and /usr/local/...
# on all nodes.
#
if [ "$clean" = "clean" ]; then
   rm -f /usr/lib/tmac/tmac.utchemdoc ; echo "/usr/lib/tmac/tmac.utchemdoc removed."
   rm -f /usr/lib/tmac/tmac.*vcat ; echo "/usr/lib/tmac/tmac.*vcat removed."
fi
if [ -f /usr/lib/tmac/tmac.utchemdoc ]; then
   echo "/usr/lib/tmac/tmac.utchemdoc already exists - do nothing."
else
   ln -s /usr/local/lib/tmac/tmac.utchemdoc /usr/lib/tmac/tmac.utchemdoc
   echo "/usr/lib/tmac/tmac.utchemdoc (re)linked."
fi
if [ -f /usr/lib/tmac/tmac.psh_vcat ]; then
   echo "/usr/lib/tmac/tmac.psh_vcat already exists - do nothing."
else
   ln -s /usr/local/lib/tmac/tmac.psh_vcat /usr/lib/tmac/tmac.psh_vcat
   echo "/usr/lib/tmac/tmac.psh_vcat (re)linked."
fi
if [ -f /usr/lib/tmac/tmac.pst_vcat ]; then
   echo "/usr/lib/tmac/tmac.pst_vcat already exists - do nothing."
else
   ln -s /usr/local/lib/tmac/tmac.pst_vcat /usr/lib/tmac/tmac.pst_vcat
   echo "/usr/lib/tmac/tmac.pst_vcat (re)linked."
fi
if [ -f /usr/lib/tmac/tmac.vcat ]; then
   echo "/usr/lib/tmac/tmac.vcat already exists - do nothing."
else
   ln -s /usr/local/lib/tmac/tmac.vcat /usr/lib/tmac/tmac.vcat
   echo "/usr/lib/tmac/tmac.vcat (re)linked."
fi
#
# Make links between /tftp/... and /usr/local/....
# on //plumbum and //aurum only.
#
if [ $host = plumbum -o $host = aurum ]; then
   if [ "$clean" = "clean" ]; then
      rm -f /tftp/cisco.confg ; echo "/tftp/cisco.confg removed."
      rm -f /tftp/ventus.confg ; echo "/tftp/ventus.confg removed."
   fi
   if [ -f /tftp/cisco.confg ]; then
      echo "/tftp/cisco.confg already exists - do nothing."
   else
      ln -s ../usr/local/cisco.confg /tftp/cisco.confg
      echo "/tftp/cisco.confg linked to ../usr/local/cisco.confg"
   fi
   if [ -f /tftp/ventus.confg ]; then
      echo "/tftp/ventus.confg already exists - do nothing."
   else
      ln -s ../usr/local/ventus.confg /tftp/ventus.confg
      echo "/tftp/ventus.confg linked to ../usr/local/ventus.confg"
   fi
fi
#
# Make link between /usr/spool/rwho and //plumbum/usr/spool/rwho
# on //aqua.
#
if [ $host = aqua ]; then
   if [ "$clean" = "clean" ]; then
      rm -fr /usr/spool/rwho ; echo "/usr/spool/rwho removed."
   fi
   if [ -d /usr/spool/rwho ]; then
      echo "/usr/spool/rwho already exists - do nothing."
   else
      ln -s //plumbum/usr/spool/rwho /usr/spool/rwho
      echo "/usr/spool/rwho linked to //plumbum/usr/spool/rwho"
   fi
fi
#
# Make link between /usr/spool/mail and //plumbum/usr/spool/mail
# on all nodes except //plumbum.
#
if [ $host != plumbum ]; then
   if [ "$clean" = "clean" ]; then
      rm -fr /usr/spool/mail ; echo "/usr/spool/mail removed."
   fi
   if [ -d /usr/spool/mail ]; then
      echo "/usr/spool/mail already exists - do nothing."
   else
      ln -s //plumbum/usr/spool/mail /usr/spool/mail
      echo "/usr/spool/mail linked to //plumbum/usr/spool/mail"
   fi
fi
#
# Make links for emacs between /usr/local/bin/emacs and 
# /usr/local/src/gnuemacs/emacs on //plumbum.
# Make links for emacs between /usr/local/bin/emacs and 
# /usr/local/src/gnuemacs/emacs on //todah and //flatland,
# plus make local copies of critical files.
# Make links for emacs for /usr/local/bin/emacs and
# /usr/local/src/gnuemacs/emacs to //plumbum/... on //aurum and //aqua.
#
if [ $host = plumbum ]; then
   if [ "$clean" = "clean" ]; then
      rm -f /usr/local/bin/emacs ; echo "/usr/local/bin/emacs removed."
   fi
   if [ -f /usr/local/bin/emacs ]; then
      echo "/usr/local/bin/emacs already exists - do nothing."
   else
      ln -s /usr/local/src/gnuemacs/emacs /usr/local/bin/emacs
      echo "/usr/local/bin/emacs linked to /usr/local/src/gnuemacs/emacs."
   fi
fi
if [ $host = todah -o $host = flatland ]; then
   d1=//plumbum/usr/local/src/gnuemacs
   d2=/usr/local/src/gnuemacs
   if [ "$clean" = "clean" ]; then
      rm -fr /usr/local/src/gnuemacs ; echo "/usr/local/src/gnuemacs removed."
      rm -f /usr/local/bin/emacs ; echo "/usr/local/bin/emacs removed."
   fi
   if [ ! -d /usr/local/src/gnuemacs ]; then
      mkdir /usr/local/src/gnuemacs /usr/local/src/gnuemacs/etc
      echo "Copy minimum set of emacs support routines:"
      cp -ov $d1/{APOLLO.README,emacs} $d2
      cp -ov $d1/etc/apollo.{elc,icons} $d2/etc
      cp -ov $d1/etc/{env,etags,loadst,movemail,emacsclient,server} $d2/etc
      cp -ov $d1/etc/{COPYING,DISTRIB,DOC-18.54.0,GNU,NEWS,TUTORIAL} $d2/etc
   fi
   if [ -f /usr/local/bin/emacs ]; then
      echo "/usr/local/bin/emacs already exists - do nothing."
   else
      ln -s /usr/local/src/gnuemacs/emacs /usr/local/bin/emacs
      echo "/usr/local/bin/emacs linked to /usr/local/src/gnuemacs/emacs."
   fi
   if [ -d /usr/local/src/gnuemacs/info ]; then
      echo "/usr/local/src/gnuemacs/info already exists - do nothing."
   else
      ln -s //plumbum/usr/local/src/gnuemacs/info /usr/local/src/gnuemacs/info
      echo "/usr/local/src/gnuemacs/info linked to //plumbum/usr/local/src/gnuemacs/info."
   fi
   if [ -d /usr/local/src/gnuemacs/lisp ]; then
      echo "/usr/local/src/gnuemacs/lisp already exists - do nothing."
   else
      ln -s //plumbum/usr/local/src/gnuemacs/lisp /usr/local/src/gnuemacs/lisp
      echo "/usr/local/src/gnuemacs/lisp linked to //plumbum/usr/local/src/gnuemacs/lisp."
   fi
fi
if [ $host = aurum -o $host = aqua ]; then
   if [ "$clean" = "clean" ]; then
      rm -f /usr/local/bin/emacs ; echo "/usr/local/bin/emacs removed."
      rm -f /usr/local/src/gnuemacs; echo "/usr/local/src/gnuemacs removed."
   fi
   if [ -f /usr/local/bin/emacs ]; then
      echo "/usr/local/bin/emacs already exists - do nothing."
   else
      ln -s //plumbum/usr/local/src/gnuemacs/emacs /usr/local/bin/emacs
      echo "/usr/local/bin/emacs linked to //plumbum/usr/local/src/gnuemacs/emacs."
   fi
   if [ -d /usr/local/src/gnuemacs ]; then
      echo "/usr/local/src/gnuemacs already exists - do nothing."
   else
      ln -s //plumbum/usr/local/src/gnuemacs /usr/local/src/gnuemacs
      echo "/usr/local/src/gnuemacs linked to //plumbum/usr/local/src/gnuemacs."
   fi
fi
#
# Make links for mg between /usr/local/bin/mg and 
# //plumbum/usr/local/bin/mg on //aqua.
#
if [ $host = todah -o $host = aurum -o $host = flatland ]; then
   f1=//plumbum/usr/local/bin/mg
   f2=/usr/local/bin/mg
   if [ "$clean" = "clean" ]; then
      rm -f $f2 ; echo "$f2 removed."
   fi
   if [ -f $f2 ]; then
      echo "$f2 already exists - do nothing."
   else
      cp -o $f1 $f2
      echo "$f1 copied to $f2."
   fi
fi
if [ $host = aqua ]; then
   f1=//plumbum/usr/local/bin/mg
   f2=/usr/local/bin/mg
   if [ "$clean" = "clean" ]; then
      rm -f $f2 ; echo "$f2 removed."
   fi
   if [ -f $f2 ]; then
      echo "$f2 already exists - do nothing."
   else
      ln -s $f1 $f2
      echo "$f2 linked to $f1."
   fi
fi
#
# Make links for /sys/ins to //plumbum/sys/ins on all other systems.
#
if [ $host != plumbum ]; then
   d1=//plumbum/sys/ins
   d2=/sys/ins
   if [ "$clean" = "clean" ]; then
      rm -f $d2 ; echo "$d2 removed."
   fi
   if [ -d $d2 ]; then
      echo "$d2 already exists - do nothing."
   else
      ln -s $d1 $d2
      echo "$d2 linked to $d1."
   fi
fi
#
# Make links for /usr/X11/lib to /usr/local on all systems.
#
f1=/usr/local/Master.uwmrc
f2=/usr/X11/lib/uwm/system.uwmrc
if [ "$clean" = "clean" ]; then
   rm -f $f2 ; echo "$f2 removed."
fi
test -L $f2
if [ "$?" = 0 ]; then
   echo "$f2 already is a link - do nothing."
else
   rm -f $f2 ; echo "$f2 removed."
   ln -s $f1 $f2
   echo "$f2 linked to $f1."
fi
#
# Make links for /usr/X11/include/bitmaps/*.xbm to ~system/xbm on all systems.
#
if [ -d ~system/xbm ]; then
   f1=~system/xbm
   f2=/usr/X11/include/bitmaps
   cwd=`pwd`
   cd $f1
   for i in *.xbm
   do
      if [ "$clean" = "clean" ]; then
         rm -f $f2/$i
         echo "$f2/$i removed."
      fi
      if [ -f $f2/$i ]; then
         echo "$f2/$i already exists - do nothing."
      else
         ln -s $f1/$i $f2/$i
         echo "$f2/$i linked to $f1/$i."
      fi
   done
   cd $cwd
fi
#
# Make /usr/spool/news directory structure on all systems.
# On all nodes it is a link to /$masternews/news.
#
f1=/$masternews/news
f2=/usr/spool/news
if [ "$clean" = "clean" ]; then
   if [ -f $f2 ]; then
      rm -f $f2 ; echo "File $f2 removed."
   else
      rmdir $f2 ; echo "Directory $f2 removed."
   fi
fi
test -L $f2
if [ "$?" = 0 ]; then
   echo "$f2 already is a link - do nothing."
else
   if [ -f $f2 ]; then
      rm -f $f2 ; echo "File $f2 removed."
   else
      rmdir $f2 ; echo "Directory $f2 removed."
   fi
   ln -s $f1 $f2
   echo "$f2 linked to $f1."
fi
#
# Make link between /g88 and //plumbum/u0/mgauss/g88 on //plumbum only.
# Create the Gaussian88 scratch directory (/tmp/g88scratch)
# if it doesn't already exist.
#
if [ $host = plumbum ]; then
   if [ "$clean" = "clean" ]; then
      rm -f /g88 ; echo "/g88 removed."
      rm -r /tmp/g88scratch ; echo "/tmp/g88scratch removed."
   fi
   if [ -d /g88 ]; then
      echo "/g88 already exists - do nothing."
   else
      ln -s //plumbum/u0/mgauss/g88 /g88
      echo "/g88 linked to //plumbum/u0/mgauss/g88."
   fi
   if [ -d /tmp/g88scratch ]; then
      echo "/tmp/g88scratch already exists - do nothing."
   else
      mkdir /tmp/g88scratch
      chmod 777 /tmp/g88scratch
      chacl -df ug=PU,z=PI,o=U /tmp/g88scratch
      echo "/tmp/g88scratch re-created."
   fi
fi
#
# Make link between /usr/games/tetris_scores and /usr/local/lib/tetris_scores,
# except on plumbum.
#
if [ $host != plumbum ]; then
   if [ "$clean" = "clean" ]; then
      rm -f /usr/games/tetris_scores ; echo "/usr/games/tetris_scores removed."
   fi
   if [ -f /usr/games/tetris_scores ]; then
      echo "/usr/games/tetris_scores already exists - do nothing."
   else
      ln -s /usr/local/lib/tetris_scores /usr/games/tetris_scores
      echo "/usr/games/tetris_scores linked to /usr/local/lib/tetris_scores."
   fi
fi
#
# Make /etc/tftpd setuid user.none.
#
if [ -f /etc/tftpd ]; then
   echo "Making /etc/tftpd setuid user.none."
   /etc/chown user.none /etc/tftpd
   /bin/chmod 4755 /etc/tftpd
fi
#
# Replace /bin/sh with /bin/ksh.
#
diff /bin/sh /bin/ksh >/dev/null 2>&1
if [ "$?" = "0" ]; then
   echo "/bin/sh and /bin/ksh already identical - do nothing."
else
   echo "/bin/sh and /bin/ksh are different - replacing /bin/sh."
   rm -f /bin/sh
   cp -p /bin/ksh /bin/sh
fi
#
# Disable /usr/ucb/compress since it doesn't work over NFS.
#
for f in /usr/ucb/compress
do
   if [ -f $f ]; then
      mv $f $f.bad
      echo "$f disabled."
   else
      echo "$f already disabled - do nothing."
   fi
done
#
exit 0
-- 
What are the chances that any computer system will ever "work" properly?
... and Slim just left town. -*- Mike Peterson, SysAdmin, U/Toronto Chemistry
Newsgroups: fj.mail-lists.apollo