Advertisement
Guest User

cec-test

a guest
Feb 22nd, 2015
535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. echo '#!/bin/bash
  2. date
  3. CURRENTTIME=`date +%s`
  4. NEWTIME=$((CURRENTTIME+45))
  5. echo set new time - 45 seconds ahead
  6. sudo date +%s -s @$NEWTIME > /dev/null
  7. date
  8. cec-client &
  9. ./clock.pl &
  10. sleep 4
  11. CURRENTTIME=`date +%s`
  12. NEWTIME=$((CURRENTTIME-10))
  13. echo going back 10 seconds
  14. sudo date +%s -s @$NEWTIME > /dev/null
  15. sleep 15
  16. CURRENTTIME=`date +%s`
  17. NEWTIME=$((CURRENTTIME-15))
  18. echo going back 15 seconds
  19. sudo date +%s -s @$NEWTIME > /dev/null
  20. sleep 20
  21. CURRENTTIME=`date +%s`
  22. NEWTIME=$((CURRENTTIME-20))
  23. echo going back 20 seconds - return to normal time
  24. sudo date +%s -s @$NEWTIME > /dev/null
  25. sleep 27
  26. echo killing cec-client and clock.pl
  27. ps ax | grep clock.pl | grep perl | awk '\''{print $1}'\'' | xargs kill
  28. ps ax | grep cec-client | grep -v grep | awk '\''{print $1}'\'' | xargs kill
  29. ' > test.sh
  30.  
  31. chmod +x test.sh
  32.  
  33. echo '#!/usr/bin/perl
  34. my $datestring = "";
  35. my $time=0;
  36.  
  37. while ($time < 100) {
  38. sleep 1;
  39. $time++;
  40. $datestring=localtime();
  41. print "System time: " . $datestring . ", absolute time in seconds: " . $time."\n";
  42. }
  43. ' > clock.pl
  44.  
  45. chmod +x clock.pl
  46.  
  47. ./test.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement