pakfire: use correct tree on x86_64.
[ipfire-2.x.git] / src / scripts / timecheck
CommitLineData
cd1a2927
MT
1#!/bin/sh
2#
3# IPCop CGIs
4#
5# This file is part of the IPCop Project
6#
7# This code is distributed under the terms of the GPL
8#
9# (c) Eric Oberlander June 2002
10#
11# /usr/local/bin/timecheck
12
ee4fdd07 13if [ -e /var/ipfire/time/enable ]; then
9e44c671
CS
14 if [ $(cat /var/ipfire/time/settings | grep period) ] && [ -e /var/lock/time/counter ]; then
15 if [ $(cat /var/lock/time/counter) -gt 0 ]; then
16 echo $(($(cat /var/lock/time/counter)-5)) > /var/lock/time/counter
cd1a2927 17 else
9e44c671
CS
18 touch /var/lock/time/settimenow
19 rm -f /var/lock/time/counter
cd1a2927
MT
20 fi
21 else
22 # EAO added 2003-08-14 for v1.3.1
23 # if settings are restored from a backup
9e44c671 24 # /var/lock/time/counter will not exist
ee4fdd07 25 if [ $(cat /var/ipfire/time/settings | grep periodic) ]; then
9e44c671 26 touch /var/lock/time/settimenow
cd1a2927
MT
27 fi
28 fi
29
9e44c671 30 if [ -e /var/lock/time/settimenow ]; then
ee4fdd07
MT
31 if [ -e /var/ipfire/time/settime.conf ]; then
32 /usr/local/bin/settime $(cat /var/ipfire/time/settime.conf)
cd1a2927
MT
33 fi
34 fi
35fi