diff --git a/scripts/dispatch.sh b/scripts/dispatch.sh old mode 100644 new mode 100755 index 6fde0ec..5670a63 --- a/scripts/dispatch.sh +++ b/scripts/dispatch.sh @@ -4,14 +4,37 @@ # TODO: Make this interactive and show the diff before and then # do the merge? -case "$SSH_ORIGINAL_COMMAND" in + +set -e + +# Extract first part... +item=1 +for i in $SSH_ORIGINAL_COMMAND; +do + if [ $item = "1" ]; then + CMD=$i + elif [ $item = "11" ]; then + MACHINE=$i + elif [ $item = "111" ]; then + RELEASE=$i + else + echo "Unknown.. $i" + fi + item="1$item" +done + +case "$CMD" in "rsync") - exec /usr/local/bin/rrsync web-files + exec /usr/local/bin/rrsync $1 ;; "diff-testing") - exec `dirname $0`/make-stable.sh $1 $2 dry-run + cd $1 + cd ../ + exec `dirname $0`/make-stable.sh $MACHINE $RELEASE dry-run ;; "merge-testing") - exec `dirname $0`/make-stable.sh $1 $2 + cd $1 + cd ../ + exec `dirname $0`/make-stable.sh $MACHINE $RELEASE ;; esac