Mercurial > hg > lukkari
comparison update.sh @ 152:4085ea7aa7a6
Few minor improvements to the update script.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 02 Oct 2014 09:11:34 +0300 |
parents | ca012374190c |
children | e97705171c3c |
comparison
equal
deleted
inserted
replaced
151:ca012374190c | 152:4085ea7aa7a6 |
---|---|
14 LISTFILE="$2.tmp" | 14 LISTFILE="$2.tmp" |
15 PATPREFIX="$3" | 15 PATPREFIX="$3" |
16 | 16 |
17 if wget -q -O "$LISTFILE" "$URLPREFIX"; then | 17 if wget -q -O "$LISTFILE" "$URLPREFIX"; then |
18 perl -ne "if (/<a href=\"${PATPREFIX}([A-Z]{3}\d\S+)${URLSUFFIX}\">/) { print \"\$1\n\"; }" < "$LISTFILE" > "$CLASSFILE" | 18 perl -ne "if (/<a href=\"${PATPREFIX}([A-Z]{3}\d\S+)${URLSUFFIX}\">/) { print \"\$1\n\"; }" < "$LISTFILE" > "$CLASSFILE" |
19 rm -f "$LISTFILE" | |
19 echo -n "* Fetched classfile $CLASSFILE: " | 20 echo -n "* Fetched classfile $CLASSFILE: " |
20 cat "$CLASSFILE" | wc -l | 21 cat "$CLASSFILE" | wc -l |
21 fi | 22 fi |
22 } | 23 } |
23 | 24 |
81 #perl parsedata.pl -xml "$INFILE" -o "${CACHEDIR}${i}.xml" | 82 #perl parsedata.pl -xml "$INFILE" -o "${CACHEDIR}${i}.xml" |
82 fi | 83 fi |
83 done | 84 done |
84 } | 85 } |
85 | 86 |
86 # Fix permissions | 87 fix_permissions() |
87 chmod 751 . && chmod 644 *.php *.css && chmod 600 coursecache.txt classes.txt classes_next.txt | 88 { |
89 chmod 751 . && chmod 644 *.php *.css && chmod 600 coursecache.txt classes.txt classes_next.txt | |
90 } | |
88 | 91 |
92 fix_permissions | |
89 CACHEDIR="cache/" | 93 CACHEDIR="cache/" |
90 fetch "http://www.oamk.fi/~heikkim/riihi1/luokat/" "classes.txt" "Ryh._" | 94 fetch "http://www.oamk.fi/~heikkim/riihi1/luokat/" "classes.txt" "Ryh._" |
91 parse "http://www.oamk.fi/~heikkim/riihi1/luokat/" "classes.txt" "Ryh._" | 95 parse "http://www.oamk.fi/~heikkim/riihi1/luokat/" "classes.txt" "Ryh._" |
92 #parse "http://www.oamk.fi/tyojarjestykset/otek/luokat/" "classes.txt" "OR_" | 96 #parse "http://www.oamk.fi/tyojarjestykset/otek/luokat/" "classes.txt" "OR_" |
93 | 97 |
94 | 98 |
95 CACHEDIR="cache-next/" | 99 CACHEDIR="cache-next/" |
96 #fetch "http://www.oamk.fi/~heikkim/riihi1/luokat/" "classes.txt" "Ryh._" | 100 #fetch "http://www.oamk.fi/~heikkim/riihi1/luokat/" "classes.txt" "Ryh._" |
97 #parse "http://www.oamk.fi/~heikkim/riihi1/luokat/" "classes.txt" "Ryh._" | 101 #parse "http://www.oamk.fi/~heikkim/riihi1/luokat/" "classes.txt" "Ryh._" |
98 | 102 |
103 fix_permissions | |
99 | 104 |
100 # http://www.oamk.fi/~heikkim/riihi[1-5]/ | 105 # http://www.oamk.fi/~heikkim/riihi[1-5]/ |
101 # http://www.oamk.fi/~heikkim/Luhti[1-5]/ | 106 # http://www.oamk.fi/~heikkim/Luhti[1-5]/ |