Created
September 9, 2017 18:42
-
-
Save ElanHasson/b43d78b99f12bfee066230223465f44a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
bucketname="node-configs" | |
bucketId=`storj list-buckets | grep "Name: $bucketname" | awk '{ print $2}'` | |
bucketfiles=`storj list-files "$bucketId"` | |
for file in * | |
do | |
echo $file | |
bucketFileId=`echo $bucketfiles | grep "Name: $file" | awk '{ print $2}'` | |
if [ -z "$bucketFileId" ] | |
then | |
echo "File not found. Will upload" | |
else | |
eval "storj remove-file $bucketId $bucketFileId" | |
fi | |
eval "storj upload-file $bucketId $file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment