21 lines
569 B
Bash
21 lines
569 B
Bash
#! /bin/bash
|
|
set -e
|
|
|
|
. "@builddir@/grub-core/modinfo.sh"
|
|
|
|
# OpenBIOS on sparc64 doesn't implement RTC
|
|
# mipsel-arc QEMU emulated RTC doesn't play well with firmware
|
|
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = mipsel-arc ]; then
|
|
exit 0
|
|
fi
|
|
|
|
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"
|
|
exit 1
|