Advertisement
wiz561

scan.pl

Dec 14th, 2015
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.49 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. $counter = 2;
  4.  
  5. open (my $fh, '>>', 'output.txt');
  6.  
  7. while ($counter <= 999) {
  8.     system("hdhomerun_config <number> set /tuner0/vchannel $counter");
  9.     $result = `timeout 5s hdhomerun_config <number> save /tuner0 - | ffmpeg -i pipe: 2>&1`;
  10.     if ($result =~ m{Video\: .+? \(})
  11.     {
  12.             $result =  $&;
  13.     }
  14.     my @words = split / /, $result;
  15.     print $fh "Channel: $counter - $words[1]\n";
  16.     $counter++;
  17. }
  18.  
  19.  
  20. system("hdhomerun_config <number> set /tuner0/vchannel none");
  21. close $fh;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement