PPP script v1.0.1 by Black Majik

I have now included a rough hack at the scripting and modem dialing
part of the dip program as a part of this package... (i believe this
is better than chat's methods of handling redialing and stuff like that).

To report errors run the "reporterror" script that came with this package.

Any questions/comments e-mail me at
	blkmajik@mcn.net
Or I am BlkMajik on IRC mostly Linpeople but sometimes EFNet and LinuxNet
server:  irc.linpeople.org  port: 6667     channel: #natter

This script package requires the following packages to already be installed
on your system:
	bmdial-0.9 or later (included with this package)
	ppp-2.2.0c or later (will work with earlier versions but the newer
		versions are recommended)
	
The purpose of this package is to estabolish a ppp connection over which
you can recieve mail and use "dumb" programs such as talk.  It will modify
the correct files and restart the correct programs so that everything 
*should* work.

To install this package you just need to type "make ; make install" as root
and make will run the configppp script for you which will ask the following
questions:
	1)	Your gateway's IP address. (see GATEWAYS at bottom)
	2)	The path to your modem device (ie. /dev/modem).
	3)	The name of your sendmail daemon.
	4)	Your ppp account's login name.
	5)	Your ppp account's password.
	6)	The phone number of your dial up ppp account.

Once the pppconfig script has been run, you will be able to run startppp
and it will *hopefully* get your ppp connection up and running. Some of 
the things startppp will/can do are as follows:
	1)	Updates /etc/hosts so talk will work
	2)	Restarts sendmail so that you can recieve mail directly on
		on your machine instead of having to use popclient
		(only works if people mail directly to your machine)
		you still have to use popclient to get your mail from your
		ISP.
	3)	With the "-m" switch it will mail the people in your
		/root/.ppp.mail file your address.  Useful if you want
		mail delivered directly to your machine from these people
		instead of having to get it from your ISP.
	4)	With the "-k" switch it will keep your connection going
		even if you have a long idle time.

SWITCHES
-------------

-m	This switch will allow you to mail the people in /root/.ppp.mail 
	your dynamic IP so that they can telnet or e-mail directly to your
	machine. The /root/.ppp.mail file has the format of one address
	per line.

-k	With this option you will have to have the following line added 
	to roots crontab:
	
	0,5,10,15,20,25,30,35,40,45,50,55 * * * *       /usr/sbin/checkppp 
	
	The pppcheck script will look for the existance of /root/.ppp.keep
	If that file is there ("startppp -k" creates it) pppcheck will
	call startppp again if the connection goes down.

FILES
------------

/etc/ppp/options
	The options file for pppd
/etc/hosts.bak
	The file that contains all the contents of /etc/hosts except for 
	your dynamic IP line.
/etc/hosts.pre
	The file that contains the information needed to start dip 
/root/hosts.old
	Your /etc/hosts file before installation of this package
/root/.ppp.bmdial
	The bmdial script used to call your ISP
/usr/sbin/startppp
	Shell script used to start your ppp connection
/usr/sbin/killppp
	Shell script that will shutdown your ppp connection including 
	remove the files that the crontab scripts uses to keep connections
	up.
/usr/sbin/checkppp
	Shell script optionally called by crontab to keep your ppp connection
	up.

OTHER FILES
--------------
These are needed by various programs in order to run properly

#------------- /etc/resolv.conf ----------------
domain	<domain.name.here>
# This next line needs your nameservers IP address.
# as in 123.456.789.987   instead of dns.domain.name
nameserver	<name.server.here>
#------------- /etc/resolv.conf ----------------


In the following file there should be only ONE line
and that is your computers full name.
example:

satan.mcn.net

which is my computers name.
-------------- /etc/HOSTNAME -------------------
machine.domain.name
-------------- /etc/HOSTNAME -------------------

MISC INFO
--------------
With some help form my friends on #linpeople I have found out a way to 
make it so that you can have a semi-static IP address (the same one all
the time).  One problem encountered with this is that you CANNOT have the
semi-static IP address if your ISP assigns you different GATEWAYS when you
login.  To do this you need to figure out what address you want to be...
A helpful hint with this... choose something with a "high" number...
Say that your ISP has dynamic address assigned to  dialXX where XX is
something like 1 - 70, you will want to choose 70 in this case because in
theory it won't be used all that much, which means it will probably be
open for your use!!!
ok now for the acutal procedure:

in your startppp script you will have a line that looks something like
this:

/sbin/pppd /dev/modem 38400

now to make it so that you can have a semi static IP you add 

<IP address you want>:<gateway>

to the end of the above line.  The <gateway> part isn't really all that
necessary though.  
eg:
/sbin/pppd /dev/modem 38400 123.345.567.789:321.543.765.987

**** NOTE: if the address is already in use you will NOT connect...
my suggestion would be to make 2 copies of the startppp script
one with and one without the semi-static stuff, or add 
ipcp-accept-local to the /sbin/pppd line.



GATEWAYS
-------------
ok... for all those people who have asked me what to put for their
gateway address here is how to find out what it is....
connect to your ISP via PPP and then run ifconfig. You should get
something that looks like this:

ppp0      Link encap:Point-Point Protocol  
          inet addr:205.163.40.62  P-t-P:205.163.40.1  Mask:255.255.255.0
          UP POINTOPOINT RUNNING  MTU:556  Metric:1
          RX packets:2423 errors:0 dropped:0 overruns:0
          TX packets:1877 errors:0 dropped:0 overruns:0


your gateway address will be the address following P-t-P.  In this case
205.163.40.1.


