From: <abe...@us...> - 2016-06-17 15:50:34
|
Revision: 7725 http://sourceforge.net/p/astlinux/code/7725 Author: abelbeck Date: 2016-06-17 15:50:31 +0000 (Fri, 17 Jun 2016) Log Message: ----------- tweak upload_script.sh script Modified Paths: -------------- branches/1.0/scripts/upload_script.sh Modified: branches/1.0/scripts/upload_script.sh =================================================================== --- branches/1.0/scripts/upload_script.sh 2016-06-16 13:31:13 UTC (rev 7724) +++ branches/1.0/scripts/upload_script.sh 2016-06-17 15:50:31 UTC (rev 7725) @@ -1,11 +1,21 @@ #!/bin/bash -for i in $(ls dl | grep -v .sha1); do - if [ ! -f dl/"$i".sha1 -a -f dl/"$i" ]; then - sha1sum dl/"$i" > dl/"$i".sha1 +action="$1" + +if [ -z "$action" ]; then + echo "Usage: upload_script.sh all|dry-run" + exit 1 +fi + +for i in $(ls -1 dl | grep -v .sha1); do + if [ -f "dl/${i}" ] && [ ! -f "dl/${i}.sha1" ]; then + echo "Adding SHA1: dl/${i}.sha1" + sha1sum "dl/${i}" > "dl/${i}.sha1" fi done -if [ -z "$1" ]; then +if [ "$action" = "all" ]; then s3cmd sync --acl-public --exclude '*/*' -v dl/ s3://astlinuxfiles/ +elif [ "$action" = "dry-run" ]; then + s3cmd sync --dry-run --exclude '*/*' -v dl/ s3://astlinuxfiles/ fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |