All of this works on my system, a Debian 2.0/intel. It will probably require tweaking on anything else, but can be made to work on most unix type systems.

Figuring out your IP Address, and letting others know.

This bit is an interaction between a few scripts. Under Debian, the default /etc/ppp/ip-up script runs all the scripts in the directory /etc/ppp/ip-up.d/.

set-ppp

So, I wrote a script, set-ppp, that takes the local IP address, and munges it to get the name of the local address, passes that on to UGCS, and saves it in a local file. It uses a tiny auxiliary script /usr/local/sbin/transfer-ppp-address to do the actual transfer.

transfer-ppp-address

This script uses a seperately generated ssh key to transfer the address. All this key is allowed to do is change the contents of the file ".ppp-address" at UGCS, so I feel fairly safe in allowing other people who can bring up PPP on my machine access to the key, instead of my regular key. The way I add these restrictions is by adding the following to the authorized key file, .ssh/authorized_keys:

from="*-ppp-its.caltech.edu",command="cat > .ppp-address",no-port-forwarding,no-X11-forwarding,no-agent-forwarding 1024 37 1....3 ppp@imladris.caltech.edu

This means that connections are only accepted from any of the Caltech dynamic PPP addresses, and that the only command that can be executed is "cat > .ppp-address". transfer-ppp-address just connects and dumps the address to that file. It also specifies a couple options to speed things up. By disabling RhostsAuthentication and RsaRhostsAuthentication, I save the connection from having to negotiate that each time. I chose gluttony for no real reason.

Getting the information

The final step is that when I am fingered, finger will display the contents of .ppp-address if it is not empty. The relevant lines are:

[ -s $dir/.ppp-address ] &&
echo "PPP:       `cat $dir/.ppp-address`"
If you can't do this or similar with the fingerd on your system, you can instead append it to your .plan or .project file, which most fingers out there will display when they exist.

When I disconnect, I want finger to acknowledge this, and not display the old address. Unfortunately, the parallel /etc/ppp/ip-down(.d) will not work for this, since they are run after the link close down. Instead, I created a local copy of poff that runs transfer-ppp-address, with stdin redirected from /dev/null. This makes the file .ppp-address have a length of 0 when it connects, since it gets an immediate EOF. Then, finger will no longer display the PPP line.

Problems

If the line drops, it will appear that my computer is still connected, even when it is not. Not much can be done about this. Also the ssh connection is somewhat costly.

Enabling PPP when you aren't home.

My system dials up once an hour and checks to see if it should stay online. It checks this by fingering me at UGCS, with "finger wnoise-ppp@ugcs.caltech.edu" I have finger check to see if there is a file .pppup in my home directory, and if so report "up". Otherwise it reports "down".

At UGCS, I do this by modifying my .finger file. Elsewhere you'll either have to do the .plan trick, or figure out some other way to communicate this information. Using ssh to run commands on the server might be a good way to go. Anyway, the relevant lines in .finger are:

#!/bin/sh
case $2 in
	ppp) if [ -f .pppup ]; then echo "up"; else echo "down"; fi
		return ;;
esac

I'll finish describing the rest of this later...