]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Enabled force setting system time on boot.
authorChristian Schmidt <maniacikarus@ipfire.org>
Sun, 11 Apr 2010 20:43:27 +0000 (22:43 +0200)
committerChristian Schmidt <maniacikarus@ipfire.org>
Sun, 11 Apr 2010 20:43:27 +0000 (22:43 +0200)
This fixes bug #0000614 for IPFire 2.7

html/cgi-bin/time.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
langs/fr/cgi-bin/fr.pl
src/initscripts/init.d/ntp

index 988a1484cc10fdb6a77180b120d55bf4c9cda6e1..fb69aa39e44af4f67e4903bdb9ca01af777304b0 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+# Copyright (C) 2010  IPFire Team                                             #
 #                                                                             #
 # 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        #
 #                                                                             #
 # 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        #
@@ -44,6 +44,7 @@ $timesettings{'UPDATE_METHOD'} = 'manually';
 $timesettings{'UPDATE_VALUE'} = '0';
 $timesettings{'UPDATE_PERIOD'} = '';
 $timesettings{'ENABLECLNTP'} = 'off';
 $timesettings{'UPDATE_VALUE'} = '0';
 $timesettings{'UPDATE_PERIOD'} = '';
 $timesettings{'ENABLECLNTP'} = 'off';
+$timesettings{'ENABLESETONBOOT'} = 'off';
 
 &Header::getcgihash(\%timesettings);
 
 
 &Header::getcgihash(\%timesettings);
 
@@ -175,6 +176,7 @@ if ($timesettings{'VALID'} eq '')
        $timesettings{'UPDATE_PERIOD'} = 'daily';
        $timesettings{'NTP_ADDR_1'} = 'de.pool.ntp.org';
        $timesettings{'NTP_ADDR_2'} = 'pool.ntp.org';
        $timesettings{'UPDATE_PERIOD'} = 'daily';
        $timesettings{'NTP_ADDR_1'} = 'de.pool.ntp.org';
        $timesettings{'NTP_ADDR_2'} = 'pool.ntp.org';
+       $timesettings{'ENABLESETONBOOT'} = 'off';
 }
 
 unless ($errormessage) {
 }
 
 unless ($errormessage) {
@@ -198,6 +200,10 @@ $checked{'ENABLECLNTP'}{'off'} = '';
 $checked{'ENABLECLNTP'}{'on'} = '';
 $checked{'ENABLECLNTP'}{$timesettings{'ENABLECLNTP'}} = "checked='checked'";
 
 $checked{'ENABLECLNTP'}{'on'} = '';
 $checked{'ENABLECLNTP'}{$timesettings{'ENABLECLNTP'}} = "checked='checked'";
 
+$checked{'ENABLESETONBOOT'}{'off'} = '';
+$checked{'ENABLESETONBOOT'}{'on'} = '';
+$checked{'ENABLESETONBOOT'}{$timesettings{'ENABLESETONBOOT'}} = "checked='checked'";
+
 $checked{'UPDATE_METHOD'}{'manually'} = '';
 $checked{'UPDATE_METHOD'}{'periodically'} = '';
 $checked{'UPDATE_METHOD'}{$timesettings{'UPDATE_METHOD'}} = "checked='checked'";
 $checked{'UPDATE_METHOD'}{'manually'} = '';
 $checked{'UPDATE_METHOD'}{'periodically'} = '';
 $checked{'UPDATE_METHOD'}{$timesettings{'UPDATE_METHOD'}} = "checked='checked'";
@@ -273,7 +279,10 @@ print <<END
 </tr>
 <tr>
        <td>&nbsp;</td>
 </tr>
 <tr>
        <td>&nbsp;</td>
-       <td class='base' colspan='2'>$Lang::tr{'set time now help'}</td>
+       <td class='base' colspan='3'>$Lang::tr{'set time now help'}</td>
+</tr>
+<tr>
+       <td class='base' colspan='4'><input type='checkbox' name='ENABLESETONBOOT' $checked{'ENABLESETONBOOT'}{'on'} /> $Lang::tr{'Set time on boot'}</td>
 </tr>
 <tr>
        <td class='base'><input type='radio' name='UPDATE_METHOD' value='periodically' $checked{'UPDATE_METHOD'}{'periodically'} /></td>
 </tr>
 <tr>
        <td class='base'><input type='radio' name='UPDATE_METHOD' value='periodically' $checked{'UPDATE_METHOD'}{'periodically'} /></td>
index 0955c0242bc28314dee16b24cb417dd759551f7d..4e59541aaa1c495a87a79a104d28759dd6dabcbe 100644 (file)
@@ -14,6 +14,7 @@
 'ConnSched add action' => 'Aktion hinzufügen',
 'ConnSched change profile title' => 'Wechsle zu Profil:',
 'ConnSched days' => 'Tage:',
 'ConnSched add action' => 'Aktion hinzufügen',
 'ConnSched change profile title' => 'Wechsle zu Profil:',
 'ConnSched days' => 'Tage:',
+'Set time on boot' => 'Erzwinge das Setzen der Systemzeit im Bootvorgang',
 'ConnSched down' => 'Runter',
 'ConnSched ipsecstart' => 'IPSec (neu)starten',
 'ConnSched ipsecstop' => 'IPSec stop',
 'ConnSched down' => 'Runter',
 'ConnSched ipsecstart' => 'IPSec (neu)starten',
 'ConnSched ipsecstop' => 'IPSec stop',
index 56faf33039208b86d265e339486a3e0c8bd1d325..1336a4ffe743a0bf98757d2d8471b0021d7b94bf 100644 (file)
@@ -47,6 +47,7 @@
 'mpfire search' => 'MPFire Search',
 'repeat' => 'Repeat',
 'shuffle' => 'Shuffle',
 'mpfire search' => 'MPFire Search',
 'repeat' => 'Repeat',
 'shuffle' => 'Shuffle',
+'Set time on boot' => 'Force setting the system clock on boot',
 'Port Rule' => 'Port-Rule',
 'qos add subclass' => 'Add subclass',
 'The source IP address is invalid.' => 'The source IP address is invalid.',
 'Port Rule' => 'Port-Rule',
 'qos add subclass' => 'Add subclass',
 'The source IP address is invalid.' => 'The source IP address is invalid.',
index 0152f0dba16605967d981de99f80fcb9a7bb51c4..e9fe7e501e18b157cfe3c01f0f8a76e5411debc4 100644 (file)
@@ -15,6 +15,7 @@
 'ConnSched change profile title' => 'Change to profile:',
 'ConnSched days' => 'Days:',
 'ConnSched down' => 'Down',
 'ConnSched change profile title' => 'Change to profile:',
 'ConnSched days' => 'Days:',
 'ConnSched down' => 'Down',
+'Set time on boot' => 'Fixé l'heure en botte',
 'ConnSched ipsecstart' => 'IPSec (re)start',
 'ConnSched ipsecstop' => 'IPSec stop',
 'ConnSched reconnect' => 'Reconnect',
 'ConnSched ipsecstart' => 'IPSec (re)start',
 'ConnSched ipsecstop' => 'IPSec stop',
 'ConnSched reconnect' => 'Reconnect',
index 825a0e810cdd8d38ed34ac97f6cafb94fae66e57..ef94de153330e5a713acbadc13d149aaf50fdf0e 100644 (file)
@@ -4,8 +4,15 @@
 . /etc/sysconfig/rc
 . $rc_functions
 
 . /etc/sysconfig/rc
 . $rc_functions
 
+eval $(/usr/local/bin/readhash /var/ipfire/time/settings)
+
 case "$1" in
        start)
 case "$1" in
        start)
+               if [ "$ENABLESETONBOOT" == "on" ]; then
+                       boot_mesg "Setting time on booot..."
+                       loadproc /usr/local/bin/settime $(cat /var/ipfire/time/settime.conf)
+               fi  
+
                boot_mesg "Starting ntpd..."
                loadproc /usr/bin/ntpd -Ap /var/run/ntpd.pid
                ;;
                boot_mesg "Starting ntpd..."
                loadproc /usr/bin/ntpd -Ap /var/run/ntpd.pid
                ;;