Add 'NONE-CKUBU2'.

This commit is contained in:
2018-05-08 11:23:49 +02:00
parent 8aca058693
commit 52c0715b15
158 changed files with 38303 additions and 0 deletions

23
NONE-CKUBU2/sbin/synctime Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
NOW=$(date +%s)
INTERVAL=$[ 8 * 60 * 60 ] # 8 hs
CONTROL=/tmp/.lastSyncTime
sync_time() {
ntpdate-debian -s || exit 1
hwclock --systohc || exit 1
touch ${CONTROL}
}
[ ! -f ${CONTROL} ] && sync_time && exit 0
SYNCRONIZED=$(stat -c %Y ${CONTROL})
SECONDS=$[ ${NOW} - ${SYNCRONIZED} ]
[ ${SECONDS} -gt ${INTERVAL} ] && sync_time && exit 0
[ ${SECONDS} -lt 0 ] && sync_time && exit 0
exit 0