/[clonezilla-sysresccd]/trunk/www/working/scripts/2site
ViewVC logotype

Annotation of /trunk/www/working/scripts/2site

Parent Directory Parent Directory | Revision Log Revision Log


Revision 99 - (hide annotations)
Mon Aug 16 13:00:26 2010 UTC (13 years, 7 months ago) by sng
File size: 13799 byte(s)
- Fixing ISO size and md5 calculation in download.html
- Updating site

1 sng 28 #!/bin/bash
2 sng 46 ##############################################################################
3     # #
4     # 2site, (C) 2007-2010 S. Georgaras <sng@hellug.gr> #
5     # #
6     # This file is part of Clonezilla-SysRescCD. #
7     # #
8     # Clonezilla-SysRescCD is free software: you can redistribute it and/or #
9     # modify it under the terms of the GNU General Public License as published #
10     # by the Free Software Foundation, either version 2 of the License, or #
11     # (at your option) any later version. #
12     # #
13     # Clonezilla-SysRescCD is distributed in the hope that it will be useful, #
14     # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16     # GNU General Public License for more details. #
17     # #
18     # You should have received a copy of the GNU General Public License along #
19     # with Clonezilla-SysRescCD. If not, see <http://www.gnu.org/licenses/>. #
20     # #
21     ##############################################################################
22 sng 28
23    
24 sng 46 ##############################################################################
25 sng 44 # Configuration section
26     #
27     # Set whereIsTheISO to the location of current Clonezilla-SysRescCD ISO file
28     # Set whereIsTheTarBall to the location of current Clonezilla-SysRescCD TGZ file
29 sng 99 whereIsTheISO=/e/clonezilla-sysresccd-"$myVersion"
30 sng 28
31 sng 46 ##############################################################################
32     # Script starts here #
33     ##############################################################################
34 sng 45
35     # Go to www/ directory
36 sng 44 cd ..
37     cd ..
38     echo 'Creating files'
39     echo -n " template.html... "
40     myDate=`sed -n '1p' working/release-data `
41     myVersion=`sed -n '2p' working/release-data `
42     thisDate=`date '+%d/%m/%Y'`
43 sng 28
44 sng 99 whereIsTheISO="$whereIsTheISO""$myVersion"
45     whereIsTheTarBall="$whereIsTheISO"/create-clonezilla-sysresccd-"$myVersion".tar.gz
46     ISO_I686_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-i686-"$myVersion"/clonezilla-sysresccd-i686-"$myVersion".iso | sed 's|[ \t].*||'`
47     ISO_I686_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-i686-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'`
48     ISO_AMD64_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-amd64-"$myVersion"/clonezilla-sysresccd-amd64-"$myVersion".iso | sed 's|[ \t].*||'`
49     ISO_AMD64_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-amd64-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'`
50     ISO_I486_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-i486-"$myVersion"/clonezilla-sysresccd-i486-"$myVersion".iso | sed 's|[ \t].*||'`
51     ISO_I486_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-i486-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'`
52    
53 sng 28 tarballSize=$(du -h "$whereIsTheTarBall" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|')
54     isoSizeEN=$(echo "$isoSize" | sed 's|,|.|')
55     # isoSizeGR=$(echo "$isoSize" | sed 's|\.|,|')
56     tarballSizeEN=$(echo "$tarballSize" | sed 's|,|.|')
57     # tarballSizeGR=$(echo "$tarballSize" | sed 's|\.|,|')
58    
59    
60    
61 sng 42 tr -d '\n' < working/clonezilla-sysresccd.rss | sed 's|<[tT][iI][tT][lL][eE]>|\n<title>|g' | sed 's|</[pP][uU][bB][Dd][aA][tT][eE]>|</pubDate>\n|g' | grep '<title>' > /tmp/iaa.$$
62 sng 28
63 sng 42 rm /tmp/aai.$$ 2>/dev/null
64 sng 28 while read line;do
65     dt="$(echo "$line" | sed 's|.*<guid isPermaLink="false">.*, ||' |sed 's| [0-9][0-9]:.*||' | sed 's|.*<pubDate>..., ||'| sed 's|\([^ ]*\) \([^ ]*\) \(.*\)|\3 \2 \1|' | sed 's|Jan|01|
66     s|Feb|02|
67     s|Mar|03|
68     s|Apr|04|
69     s|May|05|
70     s|Jun|06|
71     s|Jul|07|
72     s|Aug|08|
73     s|Sep|09|
74     s|Oct|10|
75     s|Nov|11|
76     s|Dec|12|
77     ')"
78     tit="$(echo "$line" | sed 's|</[Tt][iI][tT][lL][eE]>.*||' | sed 's|<title>||')"
79 sng 42 echo "$dt - $tit" | grep '^[0-9]' >> /tmp/aai.$$
80     done < /tmp/iaa.$$
81     rm /tmp/iaa.$$
82 sng 28
83 sng 42 l="$(cat /tmp/aai.$$ | sort -r | sed 's|^\([0-9][0-9][0-9][0-9]\) \([0-9][0-9]\) \([0-9][0-9]\) - \(.*\)|<p><a href="news.php#\4">\3/\2/\1 - \4</a></p>|' | sed -n '1,$p' | sed 's|$| \\|')"
84 sng 28
85    
86    
87 sng 42 rm /tmp/aai.$$
88 sng 28
89     sed "/<H1[^>]*>What's New<.H1>/a \
90     $l
91 sng 45 " working/.template.html | sed "s|\"myDate\"|$myDate|" | sed "s|\"myVersion\"|$myVersion|g" | sed "s|Last update: [^<]*<|Last update: $thisDate<|" > template.html
92 sng 28
93    
94     echo 'done'
95    
96 sng 42 #############################################################################
97     # #
98     # Create news.php #
99     # #
100     #############################################################################
101 sng 28
102     echo -n ' news.php... '
103     sed -n '1,/<div id="content">/p' template.html > 1.$$
104 sng 45 cat working/.news.php >> 1.$$
105 sng 28 sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$
106    
107     sed '/#content/s/width: 750px;/width: 950px/' 1.$$ | sed "s|background-image: url('images/line.png'); background-repeat:repeat-y;||
108     s|class=\"here\" ||
109     s|<a href=\"news.php\">|<a class=\"here\" href=\"news.php\">|
110     s|\"myTitle\"|What's New|
111     /<div id=\"header\">/a \
112     <a name=\"news-top\"></a>" > news.php
113     echo 'done'
114    
115    
116 sng 42 #############################################################################
117     # #
118     # Create 404.html #
119     # #
120     #############################################################################
121 sng 28 echo -n ' 404.html... '
122     sed -n '1,/<div id="content">/p' template.html > 1.$$
123     sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$
124     sed '/#content/s/width: 750px;/width: 950px/' 1.$$ | sed "s|background-image: url('images/line.png'); background-repeat:repeat-y;||
125     s|class=\"here\" ||
126     s|\"myTitle\"|Error|
127     s|#content { float: left;|#content { |
128     " > xxx.html
129     rm 1.$$
130    
131     sed -n '1,/<.[hH][eE][aA][dD]>/p' xxx.html | sed '$d' > p1.$$
132 sng 45 sed -n '1,/<!--seperator-->/p' working/.404.html >> p1.$$
133 sng 28 sed -n '/<.[hH][eE][aA][dD]>/,$p' xxx.html >> p1.$$
134     mv p1.$$ xxx.html
135    
136     sed -n '1,/<[dD][iI][vV] [iI][dD]="content">/p' xxx.html> p1.$$
137 sng 45 sed '1,/<!--seperator-->/d' working/.404.html >> p1.$$
138 sng 28 sed -n '/<[dD][iI][vV] [iI][dD]="content">/,$p' xxx.html | sed '1d' >> p1.$$
139     sed '/<!--seperator-->/d' p1.$$ > 404.html
140     rm *.$$ xxx.html
141     echo 'done'
142    
143    
144    
145 sng 42 #############################################################################
146     # #
147     # Create files (main menu) #
148     # #
149     #############################################################################
150 sng 28 # for n in index.html features.html doc.html download.html screenshots.html credits.html links.html;do
151     echo 'Creating menu files'
152     # for n in index.html screenshots.html help.html doc.html;do
153    
154    
155    
156     for n in working/*.html;do
157     # for n in working/boot-params.html;do
158     echo -n " ${n/working\//}... "
159     myTitle=`sed -n '/<[hH]3>/p' "$n" | sed '
160     2,$d
161     s/<[^<]*<[bB][rR] *\/*>\([^<]*\)<[bB][rR].*/\1/
162     s|<\/*[hH]3>||g'`
163    
164    
165     # fix first H2
166     sed '
167     s|<[hH]2[^>]*>|<H2>|g
168     0,/<[hH]2[^>]*><[aA] [nN][aA][mM][eE]/s//<H2 style="margin-top: 0;"><a name/
169     1,/<div id="content">/d
170     /<div id="footer">/,$d
171     /<div id="menu">/,$d
172     $d' "$n" > "$n".$$
173    
174    
175    
176     # # echo "myTitle = $myTitle"
177     # X=`sed '1,/<[bB][oO][dD][yY]/d' "$n".$$ | sed '/<.[bB][oO][dD][yY]>/,$d'`
178     # X=`echo "$X" | sed 's|$| \\\\|'`
179     # sed "/<div id=\"content\">/a \
180     # $X
181     # " template.html > tpm.$$
182    
183    
184     sed "/<div id=\"content\">/ r "$n".$$" template.html > tpm.$$
185    
186    
187     fonly="$n"
188     fonly="${fonly/working\//}"
189     sed '/<!--txt-only-->/!b
190     :a
191     /<!--end-txt-only-->/!{
192     N
193     ba
194     }
195     s/<!--txt-only-->.*<!--end-txt-only-->//' tpm.$$ | sed 's| $||' | sed "s|\"myTitle\"|$myTitle|
196     s|\"myVersion\"|$myVersion|g
197     s|TARBALL_SIZE|$tarballSizeEN|g
198 sng 99
199     s{ISO_I686_SIZE{$ISO_I686_SIZE{g
200     s{ISO_I686_MD5{$ISO_I686_MD5{g
201     s{ISO_I486_SIZE{$ISO_I486_SIZE{g
202     s{ISO_I486_MD5{$ISO_I486_MD5{g
203     s{ISO_AMD64_SIZE{$ISO_AMD64_SIZE{g
204     s{ISO_AMD64_MD5{$ISO_AMD64_MD5{g
205    
206 sng 28 /<[hH]1>.*<[bB][rR]/d
207     s|class=\"here\" ||
208     s|<a href=\"$fonly\">|<a class=\"here\" href=\"$fonly\">|
209     s|</div><div id=\"menu\">|<div id=\"menu\">|" > "${n/working\//}"
210    
211     rm tpm.$$ "$n".$$
212     echo 'done'
213    
214    
215     done
216    
217    
218    
219 sng 42 #############################################################################
220     # #
221     # Fix doc.html - Documentation menu #
222     # #
223     #############################################################################
224 sng 28 # num=`grep -n '<div id="linkline">' doc.html | sed 's|:.*||'`
225     #
226     # '
227     # s|class=\"here\" ||
228     # s|<a href=\"$n\">|<a class=\"here\" href=\"$n\">|' doc.html > doc.html.$$
229     # mv doc.html.$$ doc.html
230    
231    
232     echo '<H2 style="margin-top: 0;">Contents</H2>
233     <p>' >list
234    
235     echo 'Fixing documentation files'
236     count=0
237    
238 sng 37
239    
240     # for n in project.html \
241     # custom-cd.html \
242     # usb.html \
243     # boot-params.html \
244     # clonezilla.html \
245     # backup.html \
246     # backup-smb.html \
247     # restoration.html \
248     # restore.html \
249     # restore-burn.html \
250     # reloc-img.html \
251     # supergrubdisk.html \
252     # oldboot.html \
253     # sysresccd.html \
254     # partitions.html \
255     # recover.html \
256     # own-scripts.html \
257     # annex-a-devices.html
258    
259     theFiles="usb.html
260     boot-params.html
261     clonezilla.html
262     backup.html
263     backup-smb.html
264     restoration.html
265     restore.html
266     restore-burn.html
267     reloc-img.html
268     supergrubdisk.html
269     oldboot.html
270     sysresccd.html
271     partitions.html
272     recover.html
273     own-scripts.html
274     annex-a-devices.html"
275     for n in $theFiles
276 sng 28 do
277     html[count]="$n"
278     ((count++))
279     done
280    
281    
282     count=0
283     while [ -n "${html[$count]}" ]
284     do
285     if [ $count -eq 0 ];then
286     unset prev
287     else
288     prev="${html[$((count-1))]}"
289     fi
290     n="${html[$count]}"
291     next="${html[$((count+1))]}"
292     #
293     # for n in boot-params.html
294     # do
295    
296     echo -n " $n... "
297    
298     sed 's| $||' "$n" | sed "
299     /<[hH]1>.*<[bB][rR]/d
300     s|class=\"here\" ||
301     s|<a href=\"doc.html\">|<a class=\"here\" href=\"doc.html\">|
302     /#content/s/width: 750px;/width: 950px;/
303     /<div id=\"menu\">/,/<.div>/d
304     s|background-image: url('images/line.png'); background-repeat:repeat-y;||
305     " > "$n".$$
306     mv "$n".$$ "$n"
307    
308    
309     sed "/<!-- docline-top-->/a \
310     <div id=\"docline-top\">\
311     <a href=\"$prev\">&lt; PREV</a>\
312     <a href=\"doc.html\">UP</a>\
313     <a href=\"$next\">NEXT &gt;</a>\
314     </div>" "$n" | sed "/<div id=.footer.>/a \
315     <div id=\"docline-bottom\">\
316     <a href=\"$prev\">&lt; PREV</a>\
317     <a href=\"doc.html\">UP</a>\
318     <a href=\"$next\">NEXT &gt;</a>\
319     </div>" > "$n".$$
320     mv "$n".$$ "$n"
321    
322    
323    
324 sng 42 #############################################################################
325     # #
326     # contents list for doc.html #
327     # #
328     #############################################################################
329 sng 28 sed -n '/<[Hh][23]/p' "$n" | sed "1d
330     /<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d
331     s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>||
332     s|\[.*\]||
333     s|<[hH][13]>\([^<]\)|<a href=\"$n\">\1|
334     s|<[hH]2[^>]*>|\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;|
335     s|<[hH]3[^>]*>|\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;|
336     s|</[aA]>||
337     s|<[aA] [nN][aA][mM][eE]=\"|<a href=\"$n#|
338     s|</[Hh][0-9]>|</a>|
339     s| [-]*[>]*</a>|</a>|
340     s|</a>|</a><br>|
341     s|Documentation: ||
342     ">> list
343    
344    
345    
346     echo 'done'
347     ((count++))
348     done
349    
350    
351    
352     echo '</p>' >> list
353     sed '/Identifying devices in Linux/i \
354     </p> \
355     <H2 >Annex</H2> \
356     <p>' list >list.$$ && mv list.$$ list
357    
358     sed '/<div id="content">/ r list' < template.html |sed 's|class=\"here\" ||
359     s|<a href=\"doc.html\">|<a class=\"here\" href=\"doc.html\">|
360     s|\"myTitle\"|Documentation|g'> doc.html
361    
362     rm *~ list template.html 2>/dev/null
363    
364    
365 sng 37
366     #############################################################################
367     # #
368     # Creating onepage.html #
369     # #
370     #############################################################################
371    
372     echo "Creating onepage.html"
373    
374    
375    
376     sed '1,/<div id="menu">/!d
377     /<div id="menu">/d
378     s|<!--.*-->||g
379     s/margin-top: 0;/margin-top: 0; font-size: 2em;/
380     /^$/d' < index.html | sed '$d' > onepage.html
381    
382    
383     rm onepage-tmp.html 2>/dev/null
384     # exit
385     #for n in doc.html $theFiles
386     for n in $theFiles screenshots.html help.html
387     do
388     echo -n " $n... "
389     title=`sed '/<[tT][iI][tT][lL][eE]>/!d
390     s|<[^>]*>||g
391     s|Documentation: ||
392     s|Clonezilla-SysRescCD - ||' "$n"`
393    
394     sed '1,/<div id="content">/d
395     /<div id="menu">/,$d
396     /<div id="footer">/,$d' "$n" | sed "s|</[aA]>Intro|</a>$title|
397     /<H2 style=\"margin-top: 0;\">/s|margin-top: 0;|font-size: 2em;|
398     s|<!--.*-->||g
399     /^$/d" | sed '$d' >> onepage-tmp.html
400     echo 'done'
401     done
402    
403     cat onepage-tmp.html >> onepage.html
404     echo '</div>' >> onepage.html
405     sed '/<div id="menu">/,$!d' index.html |sed '/<div id="menu">/,/<.div>/d' >> onepage.html
406    
407     sed '/#content/s/width: 750px;/width: 950px;/
408     s|background-image: url('images/line.png'); background-repeat:repeat-y;||g
409     s|images/line.png||g' onepage.html > o && mv o onepage.html
410    
411     rm onepage-tmp.html 2>/dev/null
412    

Properties

Name Value
svn:executable *

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26