diff options
author | ivan <ivan> | 2000-10-27 20:15:50 +0000 |
---|---|---|
committer | ivan <ivan> | 2000-10-27 20:15:50 +0000 |
commit | 52b07e8abd3946578a6c2701ec9e5195ec6b17e6 (patch) | |
tree | 23cf8de00fab29ec9d9d805dbdd167cc60590bd7 /fs_sesmon/fs_session_server | |
parent | bd732e6950eb76b971113502f1dd8a97a21f3888 (diff) |
session monitor
Diffstat (limited to 'fs_sesmon/fs_session_server')
-rw-r--r-- | fs_sesmon/fs_session_server | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/fs_sesmon/fs_session_server b/fs_sesmon/fs_session_server new file mode 100644 index 000000000..be0a01710 --- /dev/null +++ b/fs_sesmon/fs_session_server @@ -0,0 +1,53 @@ +#!/usr/bin/perl -Tw +# +# fs_session_server +# + +use strict; +use vars qw( $opt $Debug ); +use IO::Handle; +use Net::SSH qw(sshopen3) +use FS::UID qw(adminsuidsetup); +use FS::Record qw( qsearch qsearchs ); +#use FS::cust_main_county; +#use FS::cust_main; +use FS::session; + +#require "configfile"; +$Debug = 1; + +my $user = shift or die &usage; +&adminsuidsetup( $user ); + +my $machine = shift or die &usage; + +my $fs_sessiond = "/usr/local/sbin/fs_sessiond"; + +my $me = "[fs_session_server]"; + +while (1) { + my($reader, $writer) = (new IO::Handle, new IO::Handle); + $writer->autoflush(1); + warn "$me Connecting to $machine\n" if $Debug; + sshopen2($machine,$reader,$writer,$fs_signupd); + + warn "$me Entering main loop\n" if $Debug; + while (1) { + warn "$me Reading (waiting for) data\n" if $Debug; + my $command = scalar(<$reader)); + #DoS protection here too, to protect against a compromised client? *sigh* + while ( ( my $key = scalar(<$reader>) ) != "END\n" ) { + chomp $key; + chomp( $hash{$key} = scalar(<$reader>) ); + } + + if ( $command eq 'login' ) { + + } elsif ( $command eq 'logoff' ) { + + } elsif ( $command eq 'portnum' ) { + + } else { + warn "$me WARNING: unrecognized command"; + } + |