pakfire: use correct tree on x86_64.
[ipfire-2.x.git] / src / scripts / timecheck
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
13 if [ -e /var/ipfire/time/enable ]; then
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
17 else
18 touch /var/lock/time/settimenow
19 rm -f /var/lock/time/counter
20 fi
21 else
22 # EAO added 2003-08-14 for v1.3.1
23 # if settings are restored from a backup
24 # /var/lock/time/counter will not exist
25 if [ $(cat /var/ipfire/time/settings | grep periodic) ]; then
26 touch /var/lock/time/settimenow
27 fi
28 fi
29
30 if [ -e /var/lock/time/settimenow ]; then
31 if [ -e /var/ipfire/time/settime.conf ]; then
32 /usr/local/bin/settime $(cat /var/ipfire/time/settime.conf)
33 fi
34 fi
35 fi