mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2026-01-02 10:39:37 +08:00
fix for solaris
This commit is contained in:
15
acme.sh
15
acme.sh
@@ -2103,9 +2103,20 @@ _head_n() {
|
||||
}
|
||||
|
||||
_tail_n() {
|
||||
if ! tail -n "$1" 2>/dev/null; then
|
||||
if _is_solaris; then
|
||||
#fix for solaris
|
||||
tail -"$1"
|
||||
else
|
||||
tail -n "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
_tail_c() {
|
||||
if _is_solaris; then
|
||||
#fix for solaris
|
||||
tail -"$1"c
|
||||
else
|
||||
tail -c "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -2280,7 +2291,7 @@ _setopt() {
|
||||
if [ ! -f "$__conf" ]; then
|
||||
touch "$__conf"
|
||||
fi
|
||||
if [ -n "$(tail -c1 <"$__conf")" ]; then
|
||||
if [ -n "$(_tail_c 1 <"$__conf")" ]; then
|
||||
echo >>"$__conf"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user