anonymous: Mit Perl systemzeit updaten

Beitrag lesen

Hallo...

Wer will, kann mitfolgendem Script die Systemzeit aktualisieren.. (nur unter Linux)!

Das Script, setzt ausserdem root berechtigung, und eine Internet connection voraus !

<<<<<<<<<<<<<<  Anfang  <<<<<<<<<<<<<<<

#! /usr/bin/perl -w
my (@output, $output, $out, $com);
$com = "date --set='";
open (TELNET,"telnet ns.switch.ch 13 > date");
wait;
close (TELNET);
open (FILE,"date") or die "could not open file: $!";
while (<FILE>)
{
        push(@output,$_);
}
close (FILE) or die "Could not close filehandle: $!";
$date = $output[3];
chomp($date);
open (FILE,">date");
print FILE ("date --set='$date'");
close (FILE);
open (FILE,"date");
while (<FILE>)
{
        push(@date,$_);
}
close (FILE);
open (DATE,"$date[0]");
close (DATE);

<<<<<<<<<<<<<<   Ende  <<<<<<<<<<<<<<<

(c) by Anonymous