]> git.proxmox.com Git - grub2.git/blame - tests/grub_cmd_date.in
support busybox date.
[grub2.git] / tests / grub_cmd_date.in
CommitLineData
5a0c548b 1#! /bin/sh
e3734b84
VS
2set -e
3
88017d47
VS
4. "@builddir@/grub-core/modinfo.sh"
5
f93e89ef
VS
6# FIXME: OpenBIOS on sparc64 doesn't implement RTC
7if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ]; then
88017d47
VS
8 exit 0
9fi
10
e3734b84 11pdt="$(date -u +%s)"
b43b8cac 12dt=`echo date | @builddir@/grub-shell | sed 's, [A-Z][a-z]*$,,'`
e3734b84
VS
13dtg="$(date -u -d "$dt" +%s)"
14ndt="$(date -u +%s)"
15
3f9634e5
VS
16if [ $pdt -gt $dtg ] || [ $dtg -gt $ndt ]; then
17 echo "Date not in range: $pdt <= $dtg <= $ndt"
18 exit 1
19fi
20
21pdt="$(date -u +%s)"
22dt=`echo 'insmod datehook; echo $YEAR-$MONTH-$DAY $HOUR:$MINUTE:$SECOND' | @builddir@/grub-shell`
23dtg="$(date -u -d "$dt" +%s)"
24ndt="$(date -u +%s)"
25
26if [ $pdt -gt $dtg ] || [ $dtg -gt $ndt ]; then
27 echo "Date not in range: $pdt <= $dtg <= $ndt"
28 exit 1
e3734b84 29fi