#!/bin/sh
umask 022
if [ -h /etc/opt ]; then
  echo "*** /etc/opt is a symlink, removing .. "\\c
  /bin/rm -f /etc/opt
  echo done
fi
echo "*** Copying pkgadd utilities from AFS .. "\\c
OS="/afs/athena.mit.edu/system/@sys/os"
if [ -h /usr/sbin/pkgadd ]; then
  /bin/rm -f /usr/sbin/pkgadd
  cp ${OS}/usr/sbin/pkgadd /usr/sbin/pkgadd
fi
if [ -h /usr/sadm ]; then
  /bin/rm -f /usr/sadm
  mkdir /usr/sadm
  (cd ${OS}/usr/sadm ; tar -cf - .) | (cd /usr/sadm ; tar -xf -)
fi
echo done
echo "*** Installing SUNWmd, SUNWmdg, SUNWmdn .. "
echo "----"
echo "---- Please answer "yes" to questions concerning changing permissions"
echo "---- on /etc. This script fixes those permissions after the procedure"
echo "---- is finished."
echo "----"
sleep 5
cd /afs/sipb.mit.edu/service/solaris/packages/DiskSuite-4.1-sparc
/usr/sbin/pkgadd -d `pwd` SUNWmd SUNWmdg SUNWmdn
echo "*** Package installation finished, fixing /etc permissions .. "\\c
chmod g-w /etc
echo done
