Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo '#!/bin/bash
- date
- CURRENTTIME=`date +%s`
- NEWTIME=$((CURRENTTIME+45))
- echo set new time - 45 seconds ahead
- sudo date +%s -s @$NEWTIME > /dev/null
- date
- cec-client &
- ./clock.pl &
- sleep 4
- CURRENTTIME=`date +%s`
- NEWTIME=$((CURRENTTIME-10))
- echo going back 10 seconds
- sudo date +%s -s @$NEWTIME > /dev/null
- sleep 15
- CURRENTTIME=`date +%s`
- NEWTIME=$((CURRENTTIME-15))
- echo going back 15 seconds
- sudo date +%s -s @$NEWTIME > /dev/null
- sleep 20
- CURRENTTIME=`date +%s`
- NEWTIME=$((CURRENTTIME-20))
- echo going back 20 seconds - return to normal time
- sudo date +%s -s @$NEWTIME > /dev/null
- sleep 27
- echo killing cec-client and clock.pl
- ps ax | grep clock.pl | grep perl | awk '\''{print $1}'\'' | xargs kill
- ps ax | grep cec-client | grep -v grep | awk '\''{print $1}'\'' | xargs kill
- ' > test.sh
- chmod +x test.sh
- echo '#!/usr/bin/perl
- my $datestring = "";
- my $time=0;
- while ($time < 100) {
- sleep 1;
- $time++;
- $datestring=localtime();
- print "System time: " . $datestring . ", absolute time in seconds: " . $time."\n";
- }
- ' > clock.pl
- chmod +x clock.pl
- ./test.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement