3105 |
kaklik |
1 |
#!/bin/bash |
|
|
2 |
cd ../../Modules/ |
|
|
3 |
|
|
|
4 |
echo processing: `pwd` |
|
|
5 |
|
|
|
6 |
ls | while read CATEGORY; do |
|
|
7 |
if [ -d $CATEGORY ]; then |
3106 |
kaklik |
8 |
echo "processing modules category:" $CATEGORY |
3109 |
kaklik |
9 |
ls $CATEGORY | while read NAME; do # vypise seznam modulu |
|
|
10 |
if [ -d $CATEGORY/$NAME ]; then # zkontroluje jestli vypsane soubory jsou adresare |
3178 |
kaklik |
11 |
echo -n " processing module:" $NAME |
3109 |
kaklik |
12 |
if [ -r $CATEGORY/$NAME/PrjInfo.txt ]; then # existuje alespon popisny soubor? |
|
|
13 |
if [ ! -r $CATEGORY/$NAME/DOC/SRC/img/${NAME}_QRcode.png ]; then |
|
|
14 |
mkdir -p $CATEGORY/$NAME/DOC/SRC/img/ # pokud neexistuje adresar na obrazky, bude vytvoren |
|
|
15 |
echo creating $CATEGORY/$NAME/DOC/SRC/img/${NAME}_QRcode.png |
|
|
16 |
qrencode -s 15 -l L "http://www.mlab.cz/PermaLink/$NAME" -o "$CATEGORY/$NAME/DOC/SRC/img/${NAME}_QRcode.png" |
|
|
17 |
svn add --parents $CATEGORY/$NAME/DOC/SRC/img/${NAME}_QRcode.png |
|
|
18 |
fi |
3178 |
kaklik |
19 |
echo "...done" |
3109 |
kaklik |
20 |
|
|
|
21 |
elif [ -r $CATEGORY/$NAME/DirInfo.txt ]; then # existuje alespon popisny soubor adresare? |
3178 |
kaklik |
22 |
echo -n " processing modules subcategory:" $CATEGORY/$NAME/ |
3109 |
kaklik |
23 |
ls $CATEGORY/$NAME/ | while read SUBNAME; do # |
|
|
24 |
if [ -d $CATEGORY/$NAME/$SUBNAME ]; then # zkontroluje jestli vypsane soubory jsou adresare |
|
|
25 |
if [ -r $CATEGORY/$NAME/$SUBNAME/PrjInfo.txt ]; then # existuje alespon popisny soubor? |
|
|
26 |
if [ ! -r $CATEGORY/$NAME/$SUBNAME/DOC/SRC/img/${NAME}_QRcode.png ]; then |
|
|
27 |
mkdir -p $CATEGORY/$NAME/$SUBNAME/DOC/SRC/img/ # pokud neexistuje adresar na obrazky, bude vytvoren |
|
|
28 |
echo creating $CATEGORY/$NAME/$SUBNAME/DOC/SRC/img/${SUBNAME}_QRcode.png |
|
|
29 |
qrencode -s 15 -l L "http://www.mlab.cz/PermaLink/$SUBNAME" -o "$CATEGORY/$NAME/$SUBNAME/DOC/SRC/img/${SUBNAME}_QRcode.png" |
|
|
30 |
svn add --parents $CATEGORY/$NAME/$SUBNAME/DOC/SRC/img/${SUBNAME}_QRcode.png |
|
|
31 |
fi |
|
|
32 |
fi |
|
|
33 |
fi |
|
|
34 |
done |
|
|
35 |
else |
3178 |
kaklik |
36 |
echo -e "\n\r Please repair database sctructure of" $CATEGORY/$NAME/ |
3105 |
kaklik |
37 |
fi |
|
|
38 |
else |
3178 |
kaklik |
39 |
echo "Nothing to done in category" $CATEGORY |
3105 |
kaklik |
40 |
fi |
|
|
41 |
done |
|
|
42 |
else |
|
|
43 |
echo "No document dir" |
|
|
44 |
fi |
|
|
45 |
done |
|
|
46 |
|
|
|
47 |
exit 0 |