diff --git a/rootfs/usr/local/etc/docker/functions/entrypoint.sh b/rootfs/usr/local/etc/docker/functions/entrypoint.sh index 9184959..a89930a 100755 --- a/rootfs/usr/local/etc/docker/functions/entrypoint.sh +++ b/rootfs/usr/local/etc/docker/functions/entrypoint.sh @@ -264,7 +264,7 @@ __cron() { } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - __replace() { - local search="$1" replace="$2" file="${3:$2}" + local search="$1" replace="$2" file="${3:-$2}" [ -e "$file" ] || return 1 grep -s -qR -- "$search" "$file" &>/dev/null && __sed "$search" "$replace" "$file" || return 0 grep -s -qR -- "$replace" "$file" && printf '%s\n' "Changed $search to $replace in $file" && return 0 || { @@ -273,7 +273,7 @@ __replace() { } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - __find_replace() { - local search="$1" replace="$2" file="${3:$2}" + local search="$1" replace="$2" file="${3:-$2}" [ -e "$file" ] || return 1 grep -s -qR -- "$search" "$file" &>/dev/null || return 0 find "$file" -type f -not -path '.git*' -exec sed -i "s|$search|$replace|g" {} \;