]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/scripts/settime
suricata: Change midstream policy to "pass-flow"
[ipfire-2.x.git] / src / scripts / settime
index cede5f8c11009e9e85fc741d738731d05b00357d..2d181659b1015b43bc1743b90438e60f1356b0f4 100644 (file)
@@ -1,15 +1,23 @@
 #!/bin/sh
-#
-# IPCop CGIs
-#
-# This file is part of the IPCop Project
-# 
-# This code is distributed under the terms of the GPL
-#
-# (c) Eric Oberlander June 2002
-# (c) Eric Oberlander December 2002 - internationalisation added
-#
-# /usr/local/bin/settime
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007-2022  IPFire Team  <info@ipfire.org>                     #
+#                                                                             #
+# 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 <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
 
 ongreen=1
 green=$(cat /var/ipfire/ethernet/settings | grep GREEN_NETADDRESS)
@@ -44,25 +52,25 @@ if [ -n "$1" ]; then
 
                if [ "$ntpdatetest" -eq 0 ]; then
                        case $tlanguage in
-                               en ) date "+%X %Z on %d %B %Y" > /var/ipfire/time/lastset ;
+                               en ) date "+%X %Z on %d %B %Y" > /var/lock/time/lastset ;
                                        logger -t ipfire "NTP synchronisation event" ;;
-                               de ) date "+%X Uhr am %d.%m.%Y" > /var/ipfire/time/lastset ;
+                               de ) date "+%X Uhr am %d.%m.%Y" > /var/lock/time/lastset ;
                                        logger -t ipfire "NTP Synchronisierung" ;;
-                               *  ) date "+%X %Z, %Y-%m-%d" > /var/ipfire/time/lastset ;
+                               *  ) date "+%X %Z, %Y-%m-%d" > /var/lock/time/lastset ;
                                        logger -t ipfire "NTP synchronisation" ;;
                        esac
 
                        /sbin/hwclock --systohc
-                       rm -f /var/ipfire/time/settimenow
+                       rm -f /var/lock/time/settimenow
                        # reset counter variable
-                       cp /var/ipfire/time/counter.conf /var/ipfire/time/counter
+                       cp /var/ipfire/time/counter.conf /var/lock/time/counter
                else
                        case $tlanguage in
                                de ) logger -t ipfire "ntpdate fehlerhaft" ;;
                                *  ) logger -t ipfire "ntpdate error" ;;
                        esac
                fi
-       fi              
+       fi
 else
        echo Missing parameter
 fi