mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-10 11:05:54 +02:00
36 lines
932 B
Bash
36 lines
932 B
Bash
#!/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
|
|
#
|
|
# /usr/local/bin/timecheck
|
|
|
|
if [ -e /var/ipcop/time/enable ]; then
|
|
if [ $(cat /var/ipcop/time/settings | grep period) ] && [ -e /var/ipcop/time/counter ]; then
|
|
if [ $(cat /var/ipcop/time/counter) -gt 0 ]; then
|
|
echo $(($(cat /var/ipcop/time/counter)-5)) > /var/ipcop/time/counter
|
|
else
|
|
touch /var/ipcop/time/settimenow
|
|
rm -f /var/ipcop/time/counter
|
|
fi
|
|
else
|
|
# EAO added 2003-08-14 for v1.3.1
|
|
# if settings are restored from a backup
|
|
# /var/ipcop/time/counter will not exist
|
|
if [ $(cat /var/ipcop/time/settings | grep periodic) ]; then
|
|
touch /var/ipcop/time/settimenow
|
|
fi
|
|
fi
|
|
|
|
if [ -e /var/ipcop/time/settimenow ]; then
|
|
if [ -e /var/ipcop/time/settime.conf ]; then
|
|
/usr/local/bin/settime $(cat /var/ipcop/time/settime.conf)
|
|
fi
|
|
fi
|
|
fi
|