Browse Source

chef_orch plus indépendant.
main longueur max de lignes écourtée
Makefile pour doc

Citnop 3 years ago
parent
commit
3a146392d3
3 changed files with 70 additions and 26 deletions
  1. 48 24
      chef/chef_d_orchestre.sh
  2. 6 2
      cpp/main.cpp
  3. 16 0
      doc/Makefile

+ 48 - 24
chef/chef_d_orchestre.sh

@@ -2,30 +2,54 @@
2 2
 RS=/usr/bin/rsync # better copy
3 3
 NBCPU=4 # nombre de threads à lancer. correspond au nombre de CPU/cœurs. pair de préférence.
4 4
 res=0 # cmd ok/nok ?
5
-sout () # info
6
-{
7
-	/bin/echo -n -e "\e[33m"
8
-	/bin/echo ${1}
9
-	/bin/echo -n -e "\e[0m"
10
-}
11
-sok () # ok
12
-{
13
-	/bin/echo -n -e "\e[32m"
14
-	/bin/echo ${1}
15
-	/bin/echo -n -e "\e[0m"
16
-}
17
-serr () # nok
18
-{
19
-	/bin/echo -n -e "\e[31m"
20
-	/bin/echo ${1}
21
-	/bin/echo -n -e "\e[0m"
22
-}
23
-sunk () # unk
24
-{
25
-	/bin/echo -n -e "\e[34m"
26
-	/bin/echo ${1}
27
-	/bin/echo -n -e "\e[0m"
28
-}
5
+DEBUG=0 # 0 : affiche des messages de débug.  
6
+DIR1=`grep 1000 /etc/passwd | cut -d':' -f1` # répertoire utilisateur
7
+DIR2="prod" # répertoire pour les programmes
8
+DIR3="sandbox" # répertoire de travail
9
+if [ "${DEBUG}" = "0" ]
10
+then
11
+	sout () # info
12
+	{
13
+		/bin/echo -n -e "\e[33m"
14
+		/bin/echo ${1}
15
+		/bin/echo -n -e "\e[0m"
16
+	}
17
+	sok () # ok
18
+	{
19
+		/bin/echo -n -e "\e[32m"
20
+		/bin/echo ${1}
21
+		/bin/echo -n -e "\e[0m"
22
+	}
23
+	serr () # nok
24
+	{
25
+		/bin/echo -n -e "\e[31m"
26
+		/bin/echo ${1}
27
+		/bin/echo -n -e "\e[0m"
28
+	}
29
+	sunk () # unknown
30
+	{
31
+		/bin/echo -n -e "\e[34m"
32
+		/bin/echo ${1}
33
+		/bin/echo -n -e "\e[0m"
34
+	}
35
+else
36
+	sout () 
37
+	{
38
+		: # None
39
+	}
40
+	sok () 
41
+	{
42
+		:
43
+	}
44
+	serr ()
45
+	{
46
+		:
47
+	}
48
+	sunk () 
49
+	{
50
+		:
51
+	}
52
+fi
29 53
 #-------------------------------------------------------------------------------
30 54
 
31 55
 

+ 6 - 2
cpp/main.cpp

@@ -17,7 +17,8 @@ int main(int argc, char **argv)
17 17
 	if (argc < 5) // program needs: -number of threads to launch, and -file, -no site. -OutFile
18 18
 	{
19 19
 		std::cerr << "\e[33m" << "usage :" << "\e[0m" << 
20
-			" ./graphEchantTabl <nombre (pair de préférence) de threads> </path/file> <nosite> <outfile>" << '\n';
20
+			" ./graphEchantTabl <nombre (pair de préférence) de threads> </path/file> <nosite> <outfile>" 
21
+			<< '\n';
21 22
 		std::cerr << "\e[32m" << "exemple :" << "\e[0m" << 
22 23
 			" ./graphEchantTabl 4 /home/administrateur/archive/ascii_nfcapd.1745 110" <<
23 24
 			" /home/administrateur/ex_res.csv" << std::endl;
@@ -284,7 +285,10 @@ void* threadworker(void* args)
284 285
 				}
285 286
 				else
286 287
 				{
287
-					std::cerr << "\e[33m" << "Destination invalide." << "\e[0m" << " : " << ligne << " does not match : " << site2ipsubnet(nomSite, "/home/administrateur/site2ip.csv") << ", got : " << regsrxmatch[17] << '\n';
288
+					std::cerr << "\e[33m" << "Destination invalide." << "\e[0m" << " : " << 
289
+						ligne << " does not match : " << 
290
+						site2ipsubnet(nomSite, "/home/administrateur/site2ip.csv") << 
291
+						", got : " << regsrxmatch[17] << '\n';
288 292
 				}
289 293
 			}
290 294
 			else

+ 16 - 0
doc/Makefile

@@ -0,0 +1,16 @@
1
+TEX=/usr/bin/pdflatex
2
+
3
+# targets
4
+all: user_manual_dev_handbook.pdf
5
+
6
+# rules
7
+user_manual_dev_handbook.pdf: user_manual_dev_handbook.tex
8
+	: "Génération de la documention..."
9
+	${TEX} user_manual_dev_handbook.tex && ${TEX} user_manual_dev_handbook.tex
10
+	rm -f user_manual_dev_handbook.toc user_manual_dev_handbook.aux
11
+	: "Documentation générée"
12
+
13
+# clean
14
+clean: user_manual_dev_handbook.tex
15
+	rm -f user_manual_dev_handbook.aux user_manual_dev_handbook.toc user_manual_dev_handbook.log
16
+