From 17bd4887275d28a63e514ad0f6ff5d4f66e598fe Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 20 Oct 2020 16:53:28 +0200 Subject: master_mirror_sftp_root new to configure a possibly different root directory of the http mirror from the sftp user (rsync is still expected to have its root identical to the http one) --- lib/common-functions | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/common-functions') diff --git a/lib/common-functions b/lib/common-functions index 110578f..b64af00 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -871,6 +871,12 @@ failsafe_sftp() { trial_counter=20 trap 'rm -rf --one-file-system "${temp_dir}"' EXIT cat > "${temp_dir}/input" + if [ -n "${master_mirror_sftp_root}" ]; then + sed -i ' + /^\(rm\|rename\) / s@"\([^"]\+\)"@"'"${master_mirror_sftp_root}"'/\1"@g + /^ln / s@"\([^"]\+\)"$@"'"${master_mirror_sftp_root}"'/\1"@ + ' "${temp_dir}/input" + fi sed -n ' s/^rm "\([^"]\+\)"$/- \1/ s/^ln\( [^"]\S*\)* "[^"]\+" "\([^"]\+\)"$/+ \2/ -- cgit v1.2.3-54-g00ecf