From root@cybernex.net Mon May 27 00:27:09 1996
Subject: Dynamic IP Help.
In article <31A8CCC8.1FB1F7AE@ssc.wisc.edu>,
	"Khalil R. Supple" <supple@ssc.wisc.edu> writes:
>I can very vaguely recall that someone posted a script here in one of news groups.  For
>the last several days I have scanned almost every linux news group but failed to find
>one.
>
>Could someone email me a copy of such script if any?
>Or, could someone help me?
>
>Please send an email message.

Here is a dip script and a related shell. 
I used it as a bases for my own scripts, I never tried running it
directly myself. (looks like it should work.)

What I'm working on this weekend is capturing my dynamic assigned IP address,
and then creating an HTML doc that contains the IP address. I would then
ftp the HTML doc up to my web-export directory to my Internet Provider.
This way anyone can check if my link is up or done and the correct IP address.

Good Luck

-- 

chuck
chuckk@bc.cybernex.net
*************************************
If one more person at a party
asks me how to get on the Internet...

I'll f***** scream!!!
*************************************


#!/bin/sh

# shell script to dial in using dip
# and place a dynamaically assigned IP address
# into /etc/hosts
# /tmp/local_name is a file with my local machine name
# /etc/hosts.back is the default /etc/hosts file with
# 127.0.0.1 localhost as the only entry
# host command gets name of ip address
#  - Blair Sandberg <bes38869@uxa.cso.uiuc.edu>

dip /dipmis/dynamic-ip.dip 2>&1
sleep 5
ifconfig | fgrep P-t-P | cut -c21-35 > /tmp/ip
host `cat /tmp/ip` | fgrep Name | cut -c7- > /tmp/ip_name
paste /tmp/ip /tmp/ip_name /tmp/local_name > /tmp/host_bottom
cat /etc/hosts.bak /tmp/host_bottom > /etc/hosts
rm /tmp/ip
rm /tmp/ip_name
rm /tmp/host_bottom



#!/usr/sbin/dip

# Here is a dynamic script that I obtained from our ftp server (and slightly
# modified to work with my modem), along with a shell script I wrote to
# grab the assigned IP number for this call and place it into /etc/hosts.
# Hope this helps a few people out:)
# - Blair Sundberg
	#
	# Connection script for dynamic CSLIP
	# Jason Wessel
	# jwessel@uiuc.edu
	# modified for Intel modem and my machine

# I'd recommend, that the login negotiation is done not with
# 8,N,1 as this script suggests, but with 7,E,1 - and only
# after the login (i.e. ASCII) negotiations are over, and
# it's about time to start SLIP protocol, change the line
# parameters to 8,N,1.
# - Uri Blumenthal <uri@watson.ibm.com>

main:
  get $mtu 1500
	# Ip number of the slip router
	# Used for the point to point type connection
  get $remote xxx.xxx.xx.x
        # Set the desired serial port and speed.
	# Com2 is cua1
  port cua1
        # Works well with my 14400 Intel Fax Modem
  speed 38400
  parity N
  databits 8
  stopbits 1
        # Reset the modem and terminal line.
  flush
  send \r\n\r\n
	# Initialization for the Supra Fax Modem You will have to change 
	# this to match what type of modem you have
  send ATZ\r
  wait OK 2
  send AT&c1\r
  wait OK 2
  if $errlvl != 0 goto error
	# Niffty redial when busy
redial:
	# Dial our slip server from local phone
  # Uncomenet the sleep line if you are having problems with dial speed 
  # sleep 3 
  send atdt9682722\r
  wait BUSY 14
  if $errlvl == 0 goto redial
  	flush
  	wait CONNECT 60
  if $errlvl != 0 goto error

        # We are connected.  Login to the system.
login:
   sleep 3
   wait sername: 10
   if $errlvl != 0 goto error

        # REPLACE YOURLOGINNAME with your login name.

        send chuckk.ppp\r
	wait ord: 5
   if $errlvl != 0 goto error

        # REPLACE YOURPASSWORD with your password.

        send chuck2010\r
	sleep 3
	send ppp\r 
#	send default\r
	wait is 30
	get $local remote
   if $errlvl != 0 goto error
done:
   default
   print CSLIP to $remote with address $local 
   mode CSLIP
   goto exit
error:
   print SLIP to $remote failed.
exit:



