my $time = localtime; 1 while ($time + 30 > localtime); `shutdown -r now`;