#!/bin/sh if [ "$#" -ne 3 ] then echo "Usage: $0 project rendu git_repo" exit 1 fi project_id="$1" rendu="$2" git_repo="$3" if ! whereis gearman > /dev/null 2> /dev/null then echo "gearman isn't installed on this machine. Please try another one." exit 1 fi if [ ! -d "$git_repo" ]; then ls "$git_repo" echo "$git_repo: file not found" exit 2 fi FILENAME=$(basename "$git_repo") FILE="$(tar -czf - -C "$git_repo" . | base64 )" cat < std $project_id 2016 $rendu $FILENAME $FILENAME $FILE EOF