#!/usr/bin/perl
#
# 1999: Salmar Consulting Inc.  www.salmar.com
#
# showppp.pl - show me the ppp connection address
#

&show_header;
&show_body;
&http_end;

exit();

###############
# Subroutines #
###############

sub get_pppaddr {
	$pppaddr = `/sbin/ifconfig -l ppp0`;
        print "<HR NOSHADE>\n";
        print "<BR><PRE>$pppaddr</PRE><P>\n";
        print "<HR NOSHADE>\n";
}

#
sub show_header {
	print "Content-type: text/html\n\n";
	print "<HTML><HEAD><META HTTP-EQUIV='Refresh'><TITLE>La Connection Address</TITLE>\n";
	print "</HEAD>\n";
}

#
sub show_body {
	print "<BODY BGCOLOR='White'>\n";
	print "<HR noshade>\n";
	print "<H1><font color='Blue'>PPP Connection Information</font></H1>\n";
	print "<p><h3>The information you need is the number that follows  <BR>'inet addr:' (4 numbers seperated by periods).</h3>\n";
	&get_pppaddr;
}

#
sub http_end {
	print "</body>\n";
	print "</html>\n";
}
