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