|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /config/ |
Upload File : |
#!/usr/bin/perl
#cheap and sleazy version of ps
use Proc::ProcessTable;
use Mail::Sendmail;
$FORMAT = "%-6s %-10s %-8s %-24s %s\n";
$t = new Proc::ProcessTable;
foreach $p ( @{$t->table} ){
next unless $p->cmndline =~ m/syslog/;
print $p->cmndline;
exit;
}
%mail = (
'To:' => '[email protected]',
'From' => '[email protected]',
'Subject' => 'Check Syslogd on ' . `hostname`,
'Message' => 'Read the damn subject',
);
sendmail(%mail);
sleep(1);
exec 'syslogd -v -v';
sleep(1);
$t = new Proc::ProcessTable;
foreach $p ( @{$t->table} ){
next unless $p->cmndline =~ m/syslog/;
print $p->cmndline;
exit;
}
%mail = (
'To:' => '[email protected], [email protected]',
'From' => '[email protected]',
'Subject' => 'Check Syslogd on ' . `hostname`,
'Message' => 'Read the damn subject',
);
sendmail(%mail);
print "Mail sent";
exit;