allegro/scripts/check-env-bucket.sh

25 lines
491 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
# Checks the environment to see if we have all the requisite components needed
# to upload or download from the S3 bucket.
for i in AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_ENDPOINT AWS_BUCKET
do
if [ "x${!i}" = "x" ]
then
echo "$(basename $0): missing environment variable $i"
exit 1
fi
done
if [ ! which s3cmd 2> /dev/null ]
then
echo "$(basename $0): cannot find 's3cmd' to execute"
exit 1
fi
exit 0
# Versions
# 2022-08-11 - Initial version