mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-23 05:31:42 +00:00
BSD fix _time2str()
date -u -d@"12345" does not produce an error on *BSD and outputs the current date in UTC, which is not the expected output from _time2str() Fix, reorder _time2str() to attempt BSD style date first, which errors on Linux, so cascade style OS detection works correctly.
This commit is contained in:
parent
411b342a27
commit
cb11580981
12
acme.sh
12
acme.sh
@ -1374,17 +1374,17 @@ _url_replace() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_time2str() {
|
_time2str() {
|
||||||
#Linux
|
|
||||||
if date -u -d@"$1" 2>/dev/null; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
#BSD
|
#BSD
|
||||||
if date -u -r "$1" 2>/dev/null; then
|
if date -u -r "$1" 2>/dev/null; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Soaris
|
#Linux
|
||||||
|
if date -u -d@"$1" 2>/dev/null; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Solaris
|
||||||
if _exists adb; then
|
if _exists adb; then
|
||||||
_t_s_a=$(echo "0t${1}=Y" | adb)
|
_t_s_a=$(echo "0t${1}=Y" | adb)
|
||||||
echo "$_t_s_a"
|
echo "$_t_s_a"
|
||||||
|
Loading…
Reference in New Issue
Block a user