#!/usr/bin/perl -w use IO::Handle; #use POSIX qw(:termios_h); use Fcntl; use Term::ReadKey; use Time::HiRes qw ( sleep); # save pid open (PID, ">/var/run/bootlog.pid"); print PID "$$"; close(PID); ### initial aktion ### sysopen(LOGA,"/dev/vcsa1", O_NONBLOCK|O_RDWR) || die "Konnte input Konsole nicht öffnen"; open(TEST, ">>/var/log/test.log") || die "Error! can't open file /var/log/test.log\n"; open (STDOUT, ">>/var/log/test33.log") or die $!; open (STDERR, ">/var/log/test33.log") or die $!; # Strg-C Handle sub kilhd { print "User abort\n"; close(TEST); close(LOGA); #ReadMode 0, LOGA; exit 0; } local $SIG{INT} = \&kilhd; #ReadMode 1,LOGA; # Turn off controls keys #$key=0; # Main while (1) { sleep(0.2); sysread(LOGA,$buffer,10); $|=1; if ($buffer ne "\n") { syswrite(TEST,$buffer,10); #syswrite(LOGA,$buffer,1); TEST->autoflush(); LOGA->sync(); } }