MoshiachNow
IS-IT--Management
HI,
The KILL_MON sub below does not seem to get executed whem a STOP or QUIT buttons are pushed:
my $but1 = $mw -> Button(-text=>"Start nettest", -command =>\&start)-> pack(qw/-side left/); #Start button
my $but2 = $mw -> Button(-text=>"Stop nettest", -command =>sub{$STOP=1;\&KILL_MON})-> pack(qw/-side left -padx 20/);#Start button
my $but3 = $mw -> Button(-text=>"QUIT", -command =>sub{\&KILL_MON;$mw->destroy})-> pack(qw/-side left/);#Quit button
MainLoop; #This function will be executed when the button is pushed
################################################################################
sub KILL_MON
{
print STDOUT "NOW in KILL_MON\n";
&disp("\nNow cleaning up a bit both filesystems . . .\n");
close TMPFILE1;
close LOGFILE;
$Machine = "\\\\.";
$CLASS = "winmgmts:{impersonationLevel=impersonate}$Machine\\Root\\cimv2";
$WMI = Win32::OLE->GetObject( $CLASS ) || die;
foreach my $Proc ( in( $WMI->InstancesOf( "Win32_Process" ) ) ) {
my $PROCNAME = $Proc->{Name} ;
if ( $PROCNAME =~ /ftp/) {
$FTPID = $Proc->{ProcessID};
}
}
kill 9 => $FTPID if ($FTPID);
if ($LARGEST && $BRISQUE eq "YES" && $STARTED eq "YES") {
sleep 1;
system("ftp -s:c:\\temp\\MONSCRIPT5 $REMOTE_HOST c:\\temp\\END");
} elsif ($LARGEST && $STARTED eq "YES") {
sleep 1;
system("del \"\\\\$REMOTE_HOST\\$LARGEST\\100MB\"");
}
if ($STOP) {
return;
} else {
exit 1;
}
}
##################
$STOP=1 get's it's value if STOP button is pushed,$mw->destroy is executed if QUIT button is pushed,nut KILL_MON seems never to get activated.
Any ideas why ?
Long live king Moshiach !
The KILL_MON sub below does not seem to get executed whem a STOP or QUIT buttons are pushed:
my $but1 = $mw -> Button(-text=>"Start nettest", -command =>\&start)-> pack(qw/-side left/); #Start button
my $but2 = $mw -> Button(-text=>"Stop nettest", -command =>sub{$STOP=1;\&KILL_MON})-> pack(qw/-side left -padx 20/);#Start button
my $but3 = $mw -> Button(-text=>"QUIT", -command =>sub{\&KILL_MON;$mw->destroy})-> pack(qw/-side left/);#Quit button
MainLoop; #This function will be executed when the button is pushed
################################################################################
sub KILL_MON
{
print STDOUT "NOW in KILL_MON\n";
&disp("\nNow cleaning up a bit both filesystems . . .\n");
close TMPFILE1;
close LOGFILE;
$Machine = "\\\\.";
$CLASS = "winmgmts:{impersonationLevel=impersonate}$Machine\\Root\\cimv2";
$WMI = Win32::OLE->GetObject( $CLASS ) || die;
foreach my $Proc ( in( $WMI->InstancesOf( "Win32_Process" ) ) ) {
my $PROCNAME = $Proc->{Name} ;
if ( $PROCNAME =~ /ftp/) {
$FTPID = $Proc->{ProcessID};
}
}
kill 9 => $FTPID if ($FTPID);
if ($LARGEST && $BRISQUE eq "YES" && $STARTED eq "YES") {
sleep 1;
system("ftp -s:c:\\temp\\MONSCRIPT5 $REMOTE_HOST c:\\temp\\END");
} elsif ($LARGEST && $STARTED eq "YES") {
sleep 1;
system("del \"\\\\$REMOTE_HOST\\$LARGEST\\100MB\"");
}
if ($STOP) {
return;
} else {
exit 1;
}
}
##################
$STOP=1 get's it's value if STOP button is pushed,$mw->destroy is executed if QUIT button is pushed,nut KILL_MON seems never to get activated.
Any ideas why ?
Long live king Moshiach !