2017-01-23 00:47:13 +00:00
|
|
|
#! /bin/sh
|
2013-04-11 23:47:38 +00:00
|
|
|
set -e
|
|
|
|
|
2013-04-14 23:54:23 +00:00
|
|
|
. "@builddir@/grub-core/modinfo.sh"
|
|
|
|
|
2013-04-26 12:33:31 +00:00
|
|
|
# FIXME: OpenBIOS on sparc64 doesn't implement RTC
|
|
|
|
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ]; then
|
2013-04-14 23:54:23 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2013-04-11 23:47:38 +00:00
|
|
|
pdt="$(date -u +%s)"
|
2017-01-23 11:31:36 +00:00
|
|
|
dt=`echo date | @builddir@/grub-shell | sed 's, [A-Z][a-z]*$,,'`
|
2013-04-11 23:47:38 +00:00
|
|
|
dtg="$(date -u -d "$dt" +%s)"
|
|
|
|
ndt="$(date -u +%s)"
|
|
|
|
|
2013-04-30 15:41:32 +00:00
|
|
|
if [ $pdt -gt $dtg ] || [ $dtg -gt $ndt ]; then
|
|
|
|
echo "Date not in range: $pdt <= $dtg <= $ndt"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
pdt="$(date -u +%s)"
|
|
|
|
dt=`echo 'insmod datehook; echo $YEAR-$MONTH-$DAY $HOUR:$MINUTE:$SECOND' | @builddir@/grub-shell`
|
|
|
|
dtg="$(date -u -d "$dt" +%s)"
|
|
|
|
ndt="$(date -u +%s)"
|
|
|
|
|
|
|
|
if [ $pdt -gt $dtg ] || [ $dtg -gt $ndt ]; then
|
|
|
|
echo "Date not in range: $pdt <= $dtg <= $ndt"
|
|
|
|
exit 1
|
2013-04-11 23:47:38 +00:00
|
|
|
fi
|