Hallo Zusammen,
und hier mein Skript. Ich aktualisiere hiermit die Buszeit damit meine Jung-Raumcontroller alles schön anzeigen (wird einmal pro Stunde ausgeführt und funzt auch ohne zusätzliche Perl-Module ):
Code:
#!/usr/bin/perl
#
# eibtime.pl
#
# thoern, 16.12.2006
# Version 1.0
#
$grptime = "4/1/0";
$grpdate = "4/1/1";
$eibURL = "ip:localhost";
$logfile;
$ENV{'PATH'}="/usr/bin";
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
$byte1 = sprintf "%lx", $wday * 32 + $hour;
$byte2 = sprintf "%lx", $min;
$byte3 = sprintf "%lx", $sec;
print "Time: $wday $hour:$min:$sec\n";
print "Eibtime: $byte1 $byte2 $byte3\n";
system groupwrite, $eibURL, $grptime, $byte1, $byte2, $byte3;
$byte1 = sprintf "%lx", $mday;
$byte2 = sprintf "%lx", $mon + 1;
$byte3 = sprintf "%lx", $year - 100;
print "Date: $mday ", $mon + 1, " ", $year - 100, "\n";
print "Eibdate: $byte1 $byte2 $byte3\n";
system groupwrite, $eibURL, $grpdate, $byte1, $byte2, $byte3;
Ein passender cron-Job:
tesla:~# crontab -l
33 * * * * /usr/local/eib/bin/eibtime.pl >> /var/tmp/eibtime.log 2>&1
Gruss,
thoern
Lesezeichen