mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-19 11:42:43 +00:00
Do not specify s3 endpoint when TUNASYNC_S3_ENDPOINT is not set
Signed-off-by: Harry Chen <i@harrychen.xyz>
This commit is contained in:
parent
4b96d33315
commit
0c997d883f
9
s3.sh
9
s3.sh
@ -1,5 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ ! -z "${TUNASYNC_S3_ENDPOINT}" ]]; then
|
||||
ENDPOINT="--endpoint-url=${TUNASYNC_S3_ENDPOINT}"
|
||||
else
|
||||
ENDPOINT=""
|
||||
fi
|
||||
|
||||
[[ ! -d "${TUNASYNC_WORKING_DIR}" ]] && mkdir -p "${TUNASYNC_WORKING_DIR}"
|
||||
mkdir /tmp/none; cd /tmp/none # enter an empty folder, so the stars in TUNASYNC_AWS_OPTIONS are not expanded
|
||||
exec aws --no-sign-request --endpoint-url="${TUNASYNC_S3_ENDPOINT}" s3 sync ${TUNASYNC_AWS_OPTIONS} "${TUNASYNC_UPSTREAM_URL}" "${TUNASYNC_WORKING_DIR}"
|
||||
exec aws --no-sign-request ${ENDPOINT} s3 sync ${TUNASYNC_AWS_OPTIONS} "${TUNASYNC_UPSTREAM_URL}" "${TUNASYNC_WORKING_DIR}"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user