#!/bin/sh -x
#
# change-config.sh
#
# Script to change some aspects of the system configuration for SIPB
# server machines, mhpower, 7 December 1998
#
# Last updated: 24 February 1999
#
PATH=/afs/sipb.mit.edu/service/solaris/bin:$PATH
HOST_NAME=`/bin/hostname`
rm /mit/gnu
ln -s /afs/athena.mit.edu/project/gnu /mit/gnu
#
#
#
# 
# Unnecessary lines in init scripts and root's crontab
#
comment-out /etc/init.d/athena << _END_SENDMAIL_COMMENT_
echo "Removing sendmail temporary files"
if [ -d /var/spool/mqueue ]; then
        (cd /var/spool/mqueue && rm -f nf* lf*)
fi
# Sync aliases db.
/usr/lib/sendmail -bi
_END_SENDMAIL_COMMENT_

comment-out /etc/init.d/athena << _END_ATHENA_INETD_COMMENT
echo "inetd... \c"
if [ "$ACCESSON" = true ]; then
        /etc/athena/inetd -n &
else
        /etc/athena/inetd &
fi
_END_ATHENA_INETD_COMMENT_

comment-out /etc/init.d/athena << _END_MOTD_COMMENT_
echo "Editing /etc/motd... \c"
awk '{ prev = $0; } END { print prev; }' /etc/athena/version > /tmp/t1
if [ "$PUBLIC" != true ]; then
        awk '{ if (NR > 1) print $0; }' /etc/motd >> /tmp/t1
fi
mv -f /tmp/t1 /etc/motd
chmod 644 /etc/motd
echo "done."
_END_MOTD_COMMENT_

comment-out /etc/init.d/RMTMPFILES << _END_TMP_COMMENT
M=`/sbin/mount | /usr/bin/egrep '^/tmp(/| )' | /usr/bin/wc -l`
if [ $M -eq 0 ]
then
        # just remove files under directory if symbolic link
        if [ -h /tmp ]
        then
                /usr/bin/rm -rf /tmp/*
        else
                /usr/bin/rm -rf /tmp
                /usr/bin/mkdir /tmp
                /usr/bin/chmod 1777 /tmp
                /usr/bin/chgrp sys /tmp
                /usr/bin/chown sys /tmp
        fi
fi
_END_TMP_COMMENT

comment-out /etc/init.d/inetsvc << _END_SLEEP_COMMENT_
sleep 5
_END_SLEEP_COMMENT

comment-out /etc/init.d/inetsvc << _END_INETD_COMMENT_
/usr/sbin/inetd -s
_END_INETD_COMMENT_

# there is one tab in the line below that begins with "37"
comment-out /var/spool/cron/crontabs/root << _END_SENDMAIL_CRON_
37 * * * *	/etc/athena/desync; /usr/lib/sendmail -q
_END_SENDMAIL_CRON_

# there is one tab in the line below that begins with "37"
comment-out /var/spool/cron/crontabs/root << _END_CLEAN_CRON_
20 4 * * *	/etc/athena/clean_tmp_areas > /dev/null
_END_CLEAN_CRON_
#
#
