|
@@ -0,0 +1,80 @@
|
|
|
+#!/bin/bash
|
|
|
+
|
|
|
+printf "$PRINTFPATTERN" $0 : "2 Compilations. 1 Dossier. 1 Projet. Pad Privé. export/txt"
|
|
|
+
|
|
|
+if test "$TRAVIS" == "true";
|
|
|
+then
|
|
|
+ echo "[ SKIP ]"
|
|
|
+ exit 99
|
|
|
+fi
|
|
|
+
|
|
|
+URL_BASE=https%3A%2F%2Fpad.exegetes.eu.org%2Fgroup.html%2F19%2Fpad.html%2Fg.STVKtWnA83RsmVUC%24Abro2-PRIVE%2Fexport%2Ftxt
|
|
|
+URL_GARDE=https%3A%2F%2Fpad.exegetes.eu.org%2Fgroup.html%2F19%2Fpad.html%2Fg.STVKtWnA83RsmVUC%24Abro2Garde-PRIVE%2Fexport%2Ftxt
|
|
|
+DOSSIER=MonDossier$$
|
|
|
+PROJET=Abro2$$
|
|
|
+
|
|
|
+# pids conserve la liste des pids
|
|
|
+# retcode conserve le code retour de chaque pid une fois terminé
|
|
|
+handle_child() {
|
|
|
+ local tmp=()
|
|
|
+ for((i=0;i<${#pids[@]};++i));
|
|
|
+ do
|
|
|
+ if test ! -d /proc/${pids[i]};
|
|
|
+ then
|
|
|
+ wait ${pids[i]}
|
|
|
+ retcode[${pids[i]}]=$?
|
|
|
+ else
|
|
|
+ tmp+=(${pids[i]})
|
|
|
+ fi
|
|
|
+ done
|
|
|
+ pids=(${tmp[@]})
|
|
|
+}
|
|
|
+
|
|
|
+set -o monitor
|
|
|
+trap "handle_child" CHLD
|
|
|
+
|
|
|
+
|
|
|
+# Start background processes
|
|
|
+OUTPUT1=$(./cocktail -v \
|
|
|
+ -d "$DOSSIER" \
|
|
|
+ -p "$PROJET" \
|
|
|
+ -b "$URL_BASE" \
|
|
|
+ -g "$URL_GARDE" 2>&1 >/dev/null) &
|
|
|
+pids+=($!)
|
|
|
+OUTPUT="START $!"
|
|
|
+
|
|
|
+OUTPUT2=$(./cocktail -v \
|
|
|
+ -d "$DOSSIER" \
|
|
|
+ -p "$PROJET" \
|
|
|
+ -b "$URL_BASE" \
|
|
|
+ -g "$URL_GARDE" 2>&1 >/dev/null) &
|
|
|
+pids+=($!)
|
|
|
+OUTPUT=$(printf "%s\n%s" "$OUTPUT" "START $!")
|
|
|
+
|
|
|
+# Wait until all background processes are stopped
|
|
|
+while [ ${#pids[@]} -gt 0 ];
|
|
|
+do
|
|
|
+ OUTPUT=$(printf "%s\n%s %s %s" "$OUTPUT" "WAITING FOR: "${pids[@]})
|
|
|
+ sleep 4;
|
|
|
+done
|
|
|
+OUTPUT=$(printf "%s\n%s" "$OUTPUT" "STOPPED")
|
|
|
+
|
|
|
+# affichage des code retour et generation de la chaine de test
|
|
|
+for pid in "${!retcode[@]}"
|
|
|
+do
|
|
|
+ statusstring="$statusstring $pid=${retcode[$pid]}"
|
|
|
+ retcodestr="${retcodestr}${retcode[$pid]}"
|
|
|
+done
|
|
|
+echo -n "RC $statusstring "
|
|
|
+
|
|
|
+if test $retcodestr -eq "02" -o $retcodestr -eq "20";
|
|
|
+then
|
|
|
+ echo "[ OK ]"
|
|
|
+ echo "$OUTPUT"
|
|
|
+ exit 0
|
|
|
+else
|
|
|
+ echo "[FAILED]"
|
|
|
+ echo "$OUTPUT"
|
|
|
+ exit 1
|
|
|
+fi
|
|
|
+
|