mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-10-09 20:22:54 +02:00
Rearrange order of date checks
works for all "older" Linux systems, MacOS, OpenBSD and according to #teki69 also Ubuntu 25.10 .
This commit is contained in:
12
testssl.sh
12
testssl.sh
@ -475,15 +475,15 @@ HAS_GNUDATE=false
|
|||||||
HAS_FREEBSDDATE=false
|
HAS_FREEBSDDATE=false
|
||||||
HAS_OPENBSDDATE=false
|
HAS_OPENBSDDATE=false
|
||||||
if date -d @735275209 >/dev/null 2>&1; then
|
if date -d @735275209 >/dev/null 2>&1; then
|
||||||
if date -r 735275209 >/dev/null 2>&1; then
|
if date -r @735275209 >/dev/null 2>&1; then
|
||||||
# It can't do any conversion from a plain date output.
|
# Ubuntu >= 25.10
|
||||||
HAS_OPENBSDDATE=true
|
HAS_GNUDATE=true
|
||||||
elif date -r 735275209 2>&1 | grep -q "No such file"; then
|
elif date -r 735275209 2>&1 | grep -q "No such file"; then
|
||||||
# e.g. Debian 24.04, Debian 11-13
|
# e.g. Debian 24.04, Debian 11-13
|
||||||
HAS_GNUDATE=true
|
HAS_GNUDATE=true
|
||||||
elif date -r @735275209 >/dev/null 2>&1; then
|
elif date -r 735275209 >/dev/null 2>&1; then
|
||||||
# Ubuntu >= 25.10
|
# It can't do any conversion from a plain date output.
|
||||||
HAS_GNUDATE=true
|
HAS_OPENBSDDATE=true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# FreeBSD and OS X date(1) accept "-f inputformat", so do newer OpenBSD versions >~ 6.6.
|
# FreeBSD and OS X date(1) accept "-f inputformat", so do newer OpenBSD versions >~ 6.6.
|
||||||
|
Reference in New Issue
Block a user