#!/usr/bin/perl -Tw # lcd-load.pl - write system status info to InterJet LCD # version 0.0.2 # written by royce 11/03/2002 #require POSIX; use strict; #use Term::Cap; $SIG{INT} = \&move_zig; # handle interrupts cleanly $SIG{QUIT} = \&move_zig; $SIG{TERM} = \&move_zig; $SIG{PIPE} = \&move_zig; $ENV{PATH} = '/sbin:/bin:/usr/sbin:/usr/bin'; use vars qw ($users $load $raw_uptime $uptime $load1 $load5 $load15); $|=1; # set autoflush to true my $iterator = 0; my $baudrate = 57600; my $lcd_device = '/dev/cuaa1'; my $clear_screen = ' '; # This is a Control-L #my $clear_screen = "\e[2J"; my $sysname = `uname -n`; # get hostname my $osver = `uname -sr`; # get OS and revision #---------------------------------------------------------------------------- sub move_zig() { # All your LCD are belong to us :) # Called when a terminating signal is trapped. # Receive nothing. # Return nothing (exits immediately after cleanup). print "\nlcd: "; print LCD $clear_screen or die "couldn't write to lcd: $!"; # clear screen (raw control char) print LCD " Whistle InterJet \n\r\n\r"; print LCD " $osver\n\r"; print "cleared, "; close LCD or die "couldn't close lcd: $!"; print "closed.\n"; die "\n"; } #---------------------------------------------------------------------------- print "lcd: "; open( LCD, ">$lcd_device") || die "ERROR: cannot write to $lcd_device: $!\n"; # set baud rate to 57600 system ( "stty $baudrate columns 20 rows 7