#!/usr/bin/perl -w use strict; my $from = "foo\@bar.com"; my $to = "bar\@foo.com"; my $subject = "Latest IP address"; my @ifc = `/sbin/ifconfig ppp0`; chomp ($_ = $ifc[1]); /inet\ addr:(\d+\.\d+\.\d+\.\d+)\s+.*$/; open (MAIL, "|/usr/lib/sendmail -oi -t -odq") || die "Can't fork for s +endmail: $!\n"; print MAIL "From: $from\nTo: $to\nSubject: $subject\n\n"; print MAIL $1; close (MAIL);
In reply to Getting the latest IP after dial-up by barrd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |