#!/bin/bash

fn="$1"
s3_path="$2$(basename $1)"
echo "Uploading file: $fn to $s3_path"
hash_value=$(sha256sum $fn | sed 's/ .*//g')
echo "Hash value: $hash_value"

s3_cache_path="$(echo $s3_path | sed 's/s3/s3cache/g')%hash=$hash_value"


aws s3 cp $fn $s3_path
echo $s3_cache_path




