#!/usr/bin/perl $REMOTE='RCA'; # The remote name from your lircd.conf file $IRC='/usr/local/bin/rc'; # The rc program from the lirc distribution $LCK='/var/run/rc.lck'; $CMD=$ARGV[0]; $count=0; while(-f $LCK ) { # Wait up to 10 seconds to get the lock $count=$count+1; sleep(1); if ( $count==10 ) { system("logger \"$0 ERROR Timeout\""); exit; } } open(IN,">$LCK"); print IN " \n"; close(IN); while($CMD ne '' ) { $CMD =~ s/(^.)//; $torun="$IRC SEND_ONCE $REMOTE $1"; system($torun); } $torun="$IRC SEND_ONCE $REMOTE ENTER"; system($torun); unlink($LCK);