Shengqi Chen 51c4aa4500
s3.sh: set AWS_EC2_METADATA_DISABLED=true (fix #183)
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
2025-04-14 17:20:24 +08:00

16 lines
531 B
Bash
Executable File

#!/bin/bash
if [[ ! -z "${TUNASYNC_S3_ENDPOINT}" ]]; then
ENDPOINT="--endpoint-url=${TUNASYNC_S3_ENDPOINT}"
else
ENDPOINT=""
fi
# see tuna/tunasync-scripts#183
export AWS_EC2_METADATA_DISABLED=true
[[ ! -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} s3 sync --exact-timestamps ${TUNASYNC_AWS_OPTIONS} "${TUNASYNC_UPSTREAM_URL}" "${TUNASYNC_WORKING_DIR}"