#!/bin/sh
# /etc/ppp/ip-up
# Orginally written & designed by John Gotts (jgotts@engin.umich.edu)
# Rewritten & improved by Johnny Yuma (halo@engin.umich.edu)
# Date: Fri Mar 31 19:24:00 EST 1995

# Set location & name of nslookup

NSLOOKUP=/usr/bin/nslookup

# Set location & name of date program

RDATE=/usr/local/bin/rdate

# Set host to sync clock to

TIMESERVER=timesrv2.engin.umich.edu

# Set domin name

DOMAIN=dialip.mich.net

# Get the new IP number
IPADDRESS=$4

# Look up the hostname for the IP address.
$NSLOOKUP $IPADDRESS | grep $DOMAIN | awk '{print $2}' > /etc/HOSTNAME

# Set hostname (from /etc/rc.d/rc.inet1)
HOSTNAME=`cat /etc/HOSTNAME | sed 's/\..*//'`

# Set FQDN
FQDN=$HOSTNAME.$DOMAIN

# Set the machine hostname
hostname $HOSTNAME

# Set up /etc/hosts
echo "127.0.0.1	localhost " > /etc/hosts
echo "$IPNUMBER	$FQDN	$HOSTNAME" >>/etc/hosts

# Set the system clock
$RDATE $TIMESERVER

