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