X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Ftime.cgi;h=988a1484cc10fdb6a77180b120d55bf4c9cda6e1;hp=0ff559434f1c14abcb0a3547bee28cde104d488b;hb=0b09e72214df3d4d62c1a061f1e8866020877017;hpb=57d5b1381770baff23f6df588f7c88d7406edd04
diff --git a/html/cgi-bin/time.cgi b/html/cgi-bin/time.cgi
index 0ff559434f..988a1484cc 100644
--- a/html/cgi-bin/time.cgi
+++ b/html/cgi-bin/time.cgi
@@ -1,17 +1,23 @@
#!/usr/bin/perl
-#
-# IPFire CGIs
-#
-# This file is part of the IPFire Project
-#
-# This code is distributed under the terms of the GPL
-#
-# (c) Eric Oberlander June 2002
-#
-# (c) Darren Critchley June 2003 - added real time clock setting, etc
-#
-# $Id: time.cgi,v 1.4.2.11 2005/05/28 12:16:18 eoberlander Exp $
-#
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# #
+# 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 . #
+# #
+###############################################################################
use strict;
@@ -121,10 +127,10 @@ ERROR:
system ('/usr/bin/touch', "${General::swroot}/time/enable");
system ('/usr/local/bin/timectrl enable >/dev/null 2>&1');
&General::log($Lang::tr{'ntp syncro enabled'});
- unlink "${General::swroot}/time/counter";
+ unlink "/var/lock/time/counter";
if ($timesettings{'UPDATE_METHOD'} eq 'periodically')
{
- open(FILE, ">/${General::swroot}/time/counter") or die "Unable to write counter file";
+ open(FILE, ">/var/lock/time/counter") or die "Unable to write counter file";
flock(FILE, 2);
print FILE "$updateperiod\n";
close FILE;
@@ -141,7 +147,7 @@ ERROR:
else
{
unlink "${General::swroot}/time/enable";
- unlink "${General::swroot}/time/settimenow";
+ unlink "/var/lock/time/settimenow";
unlink "${General::swroot}/time/allowclients"; # DPC added to 1.3.1
system ('/usr/local/bin/timectrl disable >/dev/null 2>&1');
&General::log($Lang::tr{'ntp syncro disabled'})
@@ -156,7 +162,7 @@ ERROR:
$timesettings{'ACTION'} = &Header::cleanhtml ($timesettings{'ACTION'});
if ($timesettings{'ACTION'} eq $Lang::tr{'set time now'} && $timesettings{'ENABLENTP'} eq 'on')
{
- system ('/usr/bin/touch', "${General::swroot}/time/settimenow");
+ system ('/usr/bin/touch', "/var/lock/time/settimenow");
}
&General::readhash("${General::swroot}/time/settings", \%timesettings);
@@ -204,7 +210,7 @@ $selected{'UPDATE_PERIOD'}{$timesettings{'UPDATE_PERIOD'}} = "selected='selected
# added to v0.0.4 to refresh screen if syncro event queued
my $refresh = '';
-if ( -e "${General::swroot}/time/settimenow") {
+if ( -e "/var/lock/time/settimenow") {
$refresh = "";
}
@@ -234,10 +240,12 @@ print <;
+ close FILE;
print $output;
}
else
@@ -286,7 +294,7 @@ print <\n