Contents:	1) Tarball or FreeBSD /usr/ports
		2) Debian package
		3) RPM package
		Configuration
		Documentation

1) Tarball or FreeBSD /usr/ports
--------------------------------

If using the tarball, run
     ./configure
     make
     make install

The rest of the instructions apply whether you are using the tarball or FreeBSD /usr/ports.

Run
     dwunmakeauth -i
     dwunmakeauth

Copy examples/minimal-rcfile (in the doc directory) to /etc/dwunrc. Edit it for
your settings.

Edit /etc/ppp/ip-up (or ip-up.local) and add to the start

     CHECKIP=204.71.200.243 # one of www.yahoo.com
     CHECKIP2=209.207.224.212 # one of freshmeat.net
     if ( ! ping -c 1 $CHECKIP && ! ping -c 1 $CHECKIP2 )
     then
     	#echo '%%con:#Bad connection' > /usr/lib/dwun-msg
     	kill -USR2 `cat /var/run/dwun.pid`
     	exit 1
     fi
     kill -USR1 `cat /var/run/dwun.pid`

Run
   /usr/sbin/dwun
(or /usr/local/sbin/dwun).

2) Debian package
-----------------

Read README.debian.

3) RPM package
--------------

Edit /etc/dwunrc and check the settings there are correct.

Run the command
   dwunmakeauth
   /etc/rc.d/init.d/dwun restart

Configuration
-------------

Optionally edit /etc/ppp/ip-up (RPM/tarball), or /etc/ppp/ip-up.d/dwun (deb)
and change the IP address pinged to a stable host close to you. Your ISP's
nameserver is a good choice.

You must tell dwun how to connect and disconnect. If the connect command
launches a daemon (such as pppd without the nodetach option) you must start it
with "dwunwait". (If you don't do this, the command will exit immediately when
the daemon is launched, and dwun will stop dialing). For example, in
/etc/dwunrc

   commandon dwunwait ifup ppp0
   commandoff ifdown ppp0

If you don't specify a commandoff, dwun will just try to kill all the processes
launched with commandon. (It cannot kill daemon's like pppd without a
commandoff).

If you're using ISDN, contact me (timsuth@ihug.co.nz) so I can make ISDN work
better with dwun.

For ISDN use
   commandon trap "isdnctrl hangup ippp0" SIGTERM; isdnctrl dial ippp0; read ign
   pre_commandon dwunlog 'ipppd[' /var/log/messages
   post_commandon kill `cat /var/run/dwun-log.pid`

For wvdial use
   commandon wvdial
   redials 0
   pre_commandon dwunlog /var/log/wvdial.log
   post_commandon kill `cat /var/run/dwun-log.pid`
(and comment out any "commandoff" line).

Documentation
-------------

The HTML documentation (avaliable in the doc/ directory) is the definitive
reference. There are also several man pages available; dwun(8), dwunmakeauth(8)
and dwunrc(5).

The doc directory is /usr/doc/dwun (or /usr/share/doc/dwun) for debian systems,
/usr/doc/dwun-ver if using the RPM, /usr/share/doc/dwun for the FreeBSD ports
distribution and /usr/doc/dwun/ for a tarball installation. 

Web site is dwun.sourceforge.net and mailing list details are listed there.
