Hallo Kollegen,
ich würde gerene folgendes Skript auf meiner Dreambox aufrufen (eibd ist installiert und funktioniert):
#!/usr/bin/perl
#
# eibtime.pl - Send time and date to KNX/EIB
# Version: 1.0a
#
# Copyright (C) 2008 Thomas Hoerndlein
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, see <http://www.gnu.org/licenses/>.
$grptime = "1/6/0";
$grpdate = "1/6/1";
$eibURL = "ip:localhost";
$ENV{'PATH'}="/usr/bin";
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
$wday = 7 if !$wday; # localtime sunday is 0, KNX sunday is 7
$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;
Habe ich hier gefunden:
eibtime.pl - send time and date to KNX / EIB
Leider weiß ich nicht wie der Aufruf lautet:
. eibtime.pl oder perl -w eibtime.pl geht leider nicht. Bekomme dann folgende Fehlermeldung:
root@dm800:/var/lib/linknx# perl - w eibtime.pl
-sh: perl: not found
root@dm800:/var/lib/linknx# . eibtime_v2.pl
: not founde_v2.pl: line 2:
-sh: eibtime_v2.pl: line 3: use: not found
: not founde_v2.pl: line 3:
: not founde_v2.pl: line 4:
-sh: eibtime_v2.pl: line 6: sub: not found
-sh: eibtime_v2.pl: line 7: my: not found
: not founde_v2.pl: line 7:
-sh: eibtime_v2.pl: line 8: my: not found
: not founde_v2.pl: line 8:
-sh: eibtime_v2.pl: line 10: syntax error: unexpected "("
ich würde gerene folgendes Skript auf meiner Dreambox aufrufen (eibd ist installiert und funktioniert):
#!/usr/bin/perl
#
# eibtime.pl - Send time and date to KNX/EIB
# Version: 1.0a
#
# Copyright (C) 2008 Thomas Hoerndlein
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, see <http://www.gnu.org/licenses/>.
$grptime = "1/6/0";
$grpdate = "1/6/1";
$eibURL = "ip:localhost";
$ENV{'PATH'}="/usr/bin";
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
$wday = 7 if !$wday; # localtime sunday is 0, KNX sunday is 7
$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;
Habe ich hier gefunden:
eibtime.pl - send time and date to KNX / EIB
Leider weiß ich nicht wie der Aufruf lautet:
. eibtime.pl oder perl -w eibtime.pl geht leider nicht. Bekomme dann folgende Fehlermeldung:
root@dm800:/var/lib/linknx# perl - w eibtime.pl
-sh: perl: not found
root@dm800:/var/lib/linknx# . eibtime_v2.pl
: not founde_v2.pl: line 2:
-sh: eibtime_v2.pl: line 3: use: not found
: not founde_v2.pl: line 3:
: not founde_v2.pl: line 4:
-sh: eibtime_v2.pl: line 6: sub: not found
-sh: eibtime_v2.pl: line 7: my: not found
: not founde_v2.pl: line 7:
-sh: eibtime_v2.pl: line 8: my: not found
: not founde_v2.pl: line 8:
-sh: eibtime_v2.pl: line 10: syntax error: unexpected "("
Kommentar