2013-04-11 23:47:38 +00:00
|
|
|
#! /bin/bash
|
|
|
|
set -e
|
|
|
|
|
2013-04-14 23:54:23 +00:00
|
|
|
. "@builddir@/grub-core/modinfo.sh"
|
|
|
|
|
|
|
|
# OpenBIOS on sparc64 doesn't implement RTC
|
|
|
|
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2013-04-11 23:47:38 +00:00
|
|
|
pdt="$(date -u +%s)"
|
|
|
|
dt=`echo date | @builddir@/grub-shell`
|
|
|
|
dtg="$(date -u -d "$dt" +%s)"
|
|
|
|
ndt="$(date -u +%s)"
|
|
|
|
|
|
|
|
if [ $pdt -le $dtg ] && [ $dtg -le $ndt ]; then
|
|
|
|
exit 0;
|
|
|
|
fi
|
|
|
|
echo "Date not in range: $pdt <= $dtg <= $ndt"
|
2013-04-14 15:19:04 +00:00
|
|
|
exit 1
|