Howdy!
On Mon, 17 Jan 2000, I wrote:
> Ce ti tvoja masina zabluzi le z letom, dan, mesec, uro, minuto in
> sekundo pa ti nastavi pravilno, potem lahko naredis eno avtomatiko, ki ti
> popravi le leto (kot primer glej skripto v prilogi).
Sorry, napacna verzija skripte. Sedaj posiljam pravo.
Peace!
Mkx
---- perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
#!/bin/sh
#
# Set date to current epoch.
#
# If linux is booted from SRM console, it might get year wrong. Offset is
# +48 and this should be corrected before everything else works.
#
# month, day, hour, minute and second are set correct. Therefore we should
# get the date from SRM, set it back by 48 years, if it seems to be
# necessary, and set the date. Then we rely on NTP or some other mechanism
# to get date and time precise.
#
####
#
YEAR=`date -u +%Y`
#
# Check, if we have to fiddle with date. If the year is way too big, we
# have to do it.
#
if [ ${YEAR} -gt 2037 ]; then
YEAR=$(( ${YEAR} - 48 ))
MONTH=`date -u +%m`
DAY=`date -u +%d`
HOUR=`date -u +%H`
MINUTE=`date -u +%M`
SECOND=`date -u +%S`
DATUM="${YEAR}-${MONTH}-${DAY}"
TIME="${HOUR}:${MINUTE}:${SECOND}"
date -u -s ${DATUM}
date -u -s ${TIME}
fi