From 51257dd34b3c7c4b2f5ddb3ccb94d8b38afece94 Mon Sep 17 00:00:00 2001 From: Mercier Pierre-Olivier Date: Fri, 18 Oct 2013 09:13:13 +0200 Subject: [PATCH] New process to send a trace to Intranet --- commands/project/send_trace.sh | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 commands/project/send_trace.sh diff --git a/commands/project/send_trace.sh b/commands/project/send_trace.sh new file mode 100644 index 0000000..08c87be --- /dev/null +++ b/commands/project/send_trace.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +if [ "$#" -ne 3 ] +then + echo "Usage: $0 project rendu [login] file" + exit 1 +fi + +project_id="$1" +rendu="$2" +if [ -z "$4" ] +then + login=`basename $3` + login="${login%%.xml}" + file="$3" +else + login="$3" + file="$4" +fi + +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 ! [ -f "$file" ]; then + echo "$file: File not found" + exit 2 +fi + +if [ -z "$login" ] +then + FILENAME=$(basename "$file") +else + FILENAME="$login.xml" +fi +FILE="$(base64 $file)" + +cat < + + trace + $project_id + 2016 + $rendu + $login +$FILE + +EOF