my $spooler = `lpstat -r`; chomp($spooler); if ( $spooler eq "scheduler is not running" ) { system("lpsched"); }