#!/usr/bin/perl
#
#
open(LAST, "last | grep reboot|");
while(<LAST>) {
    if(/\((\d*)\+(\d*):(\d*)\)/) {
	$day+=$1;
	$hour+=$2;
	$min+=$3;
    }
    if(/\((\d*):(\d*)/) {
	$hour+=$1;
	$min+=$2;
    }
}
close LAST;
$uptime=($day*60*60*24)+($hour*60*60)+($min*60);
$zeit_sec=$uptime;

$sec = $zeit_sec % 60;
$zeit_sec = ($zeit_sec - $sec) / 60;
$minute = $zeit_sec % 60;
$zeit_sec = ($zeit_sec - $minute) / 60;
$hour = $zeit_sec % 24;
$zeit_sec = ($zeit_sec - $hour) / 24;
$day = $zeit_sec % 7;
$week = ($zeit_sec - $day) / 7;
print "$week Woche - $day Tage - $hour:$minute:$sec Stunden\n";

