mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-04-29 19:12:45 +00:00
Support FreeBSD's sed -i
FreeBSD's sed requires an extension for the backup file when -i is used. However, it may be zero-length to indicate that no backup is desired.
This commit is contained in:
parent
5236e81068
commit
661c3bbdb0
3
acme.sh
3
acme.sh
@ -921,6 +921,9 @@ _sed_i() {
|
||||
if sed -h 2>&1 | grep "\-i\[SUFFIX]" >/dev/null 2>&1; then
|
||||
_debug "Using sed -i"
|
||||
sed -i "$options" "$filename"
|
||||
elif sed -h 2>&1 | grep "\-i extension" >/dev/null 2>&1; then
|
||||
_debug "Using FreeBSD sed -i"
|
||||
sed -i "" "$options" "$filename"
|
||||
else
|
||||
_debug "No -i support in sed"
|
||||
text="$(cat "$filename")"
|
||||
|
Loading…
x
Reference in New Issue
Block a user