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