madrid.in.ua mpd4/>cat userkill.pl#!/usr/local/bin/perl
#
#использую для mpd4
#
$hostname="127.0.0.1";
$port="5005";
if( $ARGV[3] eq '' ) { die 'Usage: user nasip userip nasport'; };
$user=$ARGV[0];
$nasip=$ARGV[1];
$userip=$ARGV[2];
$nasport=$ARGV[3];
$nasport=$nasport+1;
$hostname="127.0.0.1";
$port="5005";
use Net::Telnet ();
$t = new Net::Telnet (Timeout => 2,Port => $port,Binmode => '\015\012',
Prompt => '/\[\]/');
$t->open("$hostname");
$t->login("mpd-login", "mpd-password");
$t->print("bundle pptp".$nasport);
$t->print("");
$t->print("close");
$t->print("");
$t->print("exit");
$t->print("");
$t->close();
exit 0;
skm.net.ua mpd5/>cat userkill_nas1.pl
#!/usr/local/bin/perl
#
#Использую для mpd5
#
$hostname="192.168.1.3";
$port="5005";
if( $ARGV[3] eq '' ) { die 'Usage: user nasip userip nasport'; };
$user=$ARGV[0];
$nasip=$ARGV[1];
$userip=$ARGV[2];
$nasport=$ARGV[3];
#$nasport=$nasport+1;
#print $nasport;
$hostname="192.168.1.3";
$port="5005";
use Net::Telnet ();
$t = new Net::Telnet (Timeout => 2,Port => $port,Binmode => '\015\012',
Prompt => '/\[\]/');
$t->open("$hostname");
$t->login("mpd-login", "mpd-password");
$t->print("bundle B-".$nasport);
$t->print("");
$t->print("close");
$t->print("");
$t->print("exit");
$t->print("");
$t->close();
exit 0;