[3291] in Release_Engineering

home help back first fref pref prev next nref lref last post

New solaris_reconf

daemon@ATHENA.MIT.EDU (Michal N Lusztig)
Fri Jul 29 14:59:22 1994

To: rel-eng@MIT.EDU, cfields@MIT.EDU, vrt@MIT.EDU
Date: Fri, 29 Jul 1994 14:59:14 EDT
From: Michal N Lusztig <miki@MIT.EDU>



   This is the future solaris_rconf (path : config/config/files/Solaris) :


#! /bin/sh
#
#       @(#)S01cdinit.sh 1.4 92/07/13 SMI
#
# Copyright (c) 1992 by Sun Microsystems, Inc. 
#
# This script reconfigures a solaris machine at IP address change

PATH=/bin:/bin/athena:/usr/athena/bin:/sbin:/usr/sbin; export PATH
.  /etc/athena/rc.conf
# Ask for the assigned hostname
echo  "THE ASSIGNED HOSTNAME IS: "
read hostname; export hostname
cp /etc/nodename /etc/nodename.saved
cp /etc/hostname.le0 /etc/hostname.le0.saved
cp /etc/defaultrouter /etc/defaultrouter.saved
echo $hostname >/etc/nodename
echo $hostname >/etc/hostname.le0
echo "THE NEW IP ADDRESS IS:"
read addr; export addr
NET=`echo $addr | awk -F. '{printf("%s.%s\n",$1,$2)}'`; export NET
GATEWAY=$NET.0.1; export GATEWAY
echo "The gateway is $GATEWAY"
echo $GATEWAY>/etc/defaultrouter
# Have to start named and set route to get the oldaddr

mv /etc/inet/hosts /etc/inet/hosts.old
echo "#" > /etc/inet/hosts
echo "# Internet host table" >> /etc/inet/hosts
echo "#" >> /etc/inet/hosts
echo "127.0.0.1 localhost       loghost" >> /etc/inet/hosts
echo "$addr     $hostname" >>/etc/inet/hosts
sed -e  "s/^HOST=$HOST/HOST=$hostname/
        s/^ADDR=$ADDR/ADDR=$addr/" \
        < /etc/athena/rc.conf > /etc/athena/rc.conf.new

mv /etc/athena/rc.conf.new /etc/athena/rc.conf

home help back first fref pref prev next nref lref last post