jeg vil installere redhat
hej jeg har fundet dette logon script til min ISP, hvordan bruger jeg det når redhat forhåbentligt kører#! /usr/bin/perl -w
# A script to get stofa connection up
# Also, a test to do sockets in perl
require 5.002;
use strict;
use Socket;
my $ID = "1748334s001\n" ; # my connection id, and a newline
my $pwd = "xxxx9999\n" ; # my password
my $cmd = 1; # command to get the net up
if ( $ARGV[0] ne "" ) { $cmd=2; } # or the one to get it down
my $host="stofa-login";
my $serviceport = "259";
my $iaddr = gethostbyname('localhost');
my $proto = getprotobyname('tcp');
my $paddr = sockaddr_in(0,$iaddr);
$|=1;
my $hisiaddr = inet_aton( $host ) || die "unknwon host";
my $hispaddr = sockaddr_in($serviceport,$hisiaddr);
socket(SOCKET, PF_INET, SOCK_STREAM, $proto) || die "socket: $!";
connect (SOCKET, $hispaddr ) || die "connect: $!";
my $line = "-" x 128;
my $ch = " ";
while ($ch ne ":" ) {
read(SOCKET, $ch, 1);
print $ch;
}
print "\n";
my $count = send(SOCKET,$ID,0);
print "Sent ID (c=$count)\n";
$ch = " ";
while ($ch ne ":" ) {
read(SOCKET, $ch, 1);
print $ch;
}
print "\n";
my $count = send(SOCKET,$pwd,0);
print "Sent pwd (c=$count)\n";
$ch = " ";
while ($ch ne ":" ) {
read(SOCKET, $ch, 1);
print $ch;
}
print "\n";
$ch = " ";
while ($ch ne ":" ) {
read(SOCKET, $ch, 1);
print $ch;
}
print "\n";
my $choice = "$cmd \n" ; # 1=connection up
my $count = send(SOCKET,$choice,0);
print "Sent choice: $cmd (c=$count)\n";
$ch = " ";
while ($ch ne "." ) {
read(SOCKET, $ch, 1);
print $ch;
}
while ($ch ne "\n" ) {
read(SOCKET, $ch, 1);
print $ch;
}
print "\n";
close SOCKET or die "couldn't close cocket: $!";
* * * *
--
Heikki Levanto LSD - Levanto Software Development <heikki@lsd.ping.dk>
