1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
#################################################################################### |
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 modify |
9 |
|
# it under the terms of the GNU General Public License as published by |
10 |
|
# 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 |
19 |
|
# along with Clonezilla-SysRescCD. If not, see <http://www.gnu.org/licenses/>. |
20 |
|
# |
21 |
|
#################################################################################### |
22 |
|
cd .. |
23 |
|
cd .. |
24 |
echo 'Creating files' |
echo 'Creating files' |
25 |
echo -n " template.html... " |
echo -n " template.html... " |
26 |
myDate=`sed -n '1p' working/release-data ` |
myDate=`sed -n '1p' working/release-data ` |
52 |
|
|
53 |
|
|
54 |
|
|
55 |
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.$$ |
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.$$ |
56 |
|
|
57 |
rm ~/tmp/aai.$$ 2>/dev/null |
rm /tmp/aai.$$ 2>/dev/null |
58 |
while read line;do |
while read line;do |
59 |
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| |
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| |
60 |
s|Feb|02| |
s|Feb|02| |
70 |
s|Dec|12| |
s|Dec|12| |
71 |
')" |
')" |
72 |
tit="$(echo "$line" | sed 's|</[Tt][iI][tT][lL][eE]>.*||' | sed 's|<title>||')" |
tit="$(echo "$line" | sed 's|</[Tt][iI][tT][lL][eE]>.*||' | sed 's|<title>||')" |
73 |
echo "$dt - $tit" | grep '^[0-9]' >> ~/tmp/aai.$$ |
echo "$dt - $tit" | grep '^[0-9]' >> /tmp/aai.$$ |
74 |
done < ~/tmp/iaa.$$ |
done < /tmp/iaa.$$ |
75 |
rm ~/tmp/iaa.$$ |
rm /tmp/iaa.$$ |
76 |
|
|
77 |
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|$| \\|')" |
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|$| \\|')" |
78 |
|
|
79 |
|
|
80 |
|
|
81 |
rm ~/tmp/aai.$$ |
rm /tmp/aai.$$ |
82 |
|
|
83 |
sed "/<H1[^>]*>What's New<.H1>/a \ |
sed "/<H1[^>]*>What's New<.H1>/a \ |
84 |
$l |
$l |
87 |
|
|
88 |
echo 'done' |
echo 'done' |
89 |
|
|
90 |
# |
############################################################################# |
91 |
# Create news.php |
# # |
92 |
# |
# Create news.php # |
93 |
|
# # |
94 |
|
############################################################################# |
95 |
|
|
96 |
echo -n ' news.php... ' |
echo -n ' news.php... ' |
97 |
sed -n '1,/<div id="content">/p' template.html > 1.$$ |
sed -n '1,/<div id="content">/p' template.html > 1.$$ |
107 |
echo 'done' |
echo 'done' |
108 |
|
|
109 |
|
|
110 |
# |
############################################################################# |
111 |
# Create 404.html |
# # |
112 |
# |
# Create 404.html # |
113 |
|
# # |
114 |
|
############################################################################# |
115 |
echo -n ' 404.html... ' |
echo -n ' 404.html... ' |
116 |
sed -n '1,/<div id="content">/p' template.html > 1.$$ |
sed -n '1,/<div id="content">/p' template.html > 1.$$ |
117 |
sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$ |
sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$ |
136 |
|
|
137 |
|
|
138 |
|
|
139 |
# |
############################################################################# |
140 |
# Create files (main menu) |
# # |
141 |
# |
# Create files (main menu) # |
142 |
|
# # |
143 |
|
############################################################################# |
144 |
# for n in index.html features.html doc.html download.html screenshots.html credits.html links.html;do |
# for n in index.html features.html doc.html download.html screenshots.html credits.html links.html;do |
145 |
echo 'Creating menu files' |
echo 'Creating menu files' |
146 |
# for n in index.html screenshots.html help.html doc.html;do |
# for n in index.html screenshots.html help.html doc.html;do |
204 |
|
|
205 |
|
|
206 |
|
|
207 |
# #Fix doc.html - Documentation menu |
############################################################################# |
208 |
|
# # |
209 |
|
# Fix doc.html - Documentation menu # |
210 |
|
# # |
211 |
|
############################################################################# |
212 |
# num=`grep -n '<div id="linkline">' doc.html | sed 's|:.*||'` |
# num=`grep -n '<div id="linkline">' doc.html | sed 's|:.*||'` |
213 |
# |
# |
214 |
# ' |
# ' |
223 |
echo 'Fixing documentation files' |
echo 'Fixing documentation files' |
224 |
count=0 |
count=0 |
225 |
|
|
226 |
for n in project.html \ |
|
227 |
custom-cd.html \ |
|
228 |
usb.html \ |
# for n in project.html \ |
229 |
boot-params.html \ |
# custom-cd.html \ |
230 |
clonezilla.html \ |
# usb.html \ |
231 |
backup.html \ |
# boot-params.html \ |
232 |
backup-smb.html \ |
# clonezilla.html \ |
233 |
restoration.html \ |
# backup.html \ |
234 |
restore.html \ |
# backup-smb.html \ |
235 |
restore-burn.html \ |
# restoration.html \ |
236 |
reloc-img.html \ |
# restore.html \ |
237 |
supergrubdisk.html \ |
# restore-burn.html \ |
238 |
oldboot.html \ |
# reloc-img.html \ |
239 |
sysresccd.html \ |
# supergrubdisk.html \ |
240 |
partitions.html \ |
# oldboot.html \ |
241 |
recover.html \ |
# sysresccd.html \ |
242 |
own-scripts.html \ |
# partitions.html \ |
243 |
annex-a-devices.html |
# recover.html \ |
244 |
|
# own-scripts.html \ |
245 |
|
# annex-a-devices.html |
246 |
|
|
247 |
|
theFiles="usb.html |
248 |
|
boot-params.html |
249 |
|
clonezilla.html |
250 |
|
backup.html |
251 |
|
backup-smb.html |
252 |
|
restoration.html |
253 |
|
restore.html |
254 |
|
restore-burn.html |
255 |
|
reloc-img.html |
256 |
|
supergrubdisk.html |
257 |
|
oldboot.html |
258 |
|
sysresccd.html |
259 |
|
partitions.html |
260 |
|
recover.html |
261 |
|
own-scripts.html |
262 |
|
annex-a-devices.html" |
263 |
|
for n in $theFiles |
264 |
do |
do |
265 |
html[count]="$n" |
html[count]="$n" |
266 |
((count++)) |
((count++)) |
309 |
|
|
310 |
|
|
311 |
|
|
312 |
# contents list for doc.html |
############################################################################# |
313 |
|
# # |
314 |
|
# contents list for doc.html # |
315 |
|
# # |
316 |
|
############################################################################# |
317 |
sed -n '/<[Hh][23]/p' "$n" | sed "1d |
sed -n '/<[Hh][23]/p' "$n" | sed "1d |
318 |
/<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d |
/<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d |
319 |
s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>|| |
s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>|| |
350 |
rm *~ list template.html 2>/dev/null |
rm *~ list template.html 2>/dev/null |
351 |
|
|
352 |
|
|
353 |
|
|
354 |
|
############################################################################# |
355 |
|
# # |
356 |
|
# Creating onepage.html # |
357 |
|
# # |
358 |
|
############################################################################# |
359 |
|
|
360 |
|
echo "Creating onepage.html" |
361 |
|
|
362 |
|
|
363 |
|
|
364 |
|
sed '1,/<div id="menu">/!d |
365 |
|
/<div id="menu">/d |
366 |
|
s|<!--.*-->||g |
367 |
|
s/margin-top: 0;/margin-top: 0; font-size: 2em;/ |
368 |
|
/^$/d' < index.html | sed '$d' > onepage.html |
369 |
|
|
370 |
|
|
371 |
|
rm onepage-tmp.html 2>/dev/null |
372 |
|
# exit |
373 |
|
#for n in doc.html $theFiles |
374 |
|
for n in $theFiles screenshots.html help.html |
375 |
|
do |
376 |
|
echo -n " $n... " |
377 |
|
title=`sed '/<[tT][iI][tT][lL][eE]>/!d |
378 |
|
s|<[^>]*>||g |
379 |
|
s|Documentation: || |
380 |
|
s|Clonezilla-SysRescCD - ||' "$n"` |
381 |
|
|
382 |
|
sed '1,/<div id="content">/d |
383 |
|
/<div id="menu">/,$d |
384 |
|
/<div id="footer">/,$d' "$n" | sed "s|</[aA]>Intro|</a>$title| |
385 |
|
/<H2 style=\"margin-top: 0;\">/s|margin-top: 0;|font-size: 2em;| |
386 |
|
s|<!--.*-->||g |
387 |
|
/^$/d" | sed '$d' >> onepage-tmp.html |
388 |
|
echo 'done' |
389 |
|
done |
390 |
|
|
391 |
|
cat onepage-tmp.html >> onepage.html |
392 |
|
echo '</div>' >> onepage.html |
393 |
|
sed '/<div id="menu">/,$!d' index.html |sed '/<div id="menu">/,/<.div>/d' >> onepage.html |
394 |
|
|
395 |
|
sed '/#content/s/width: 750px;/width: 950px;/ |
396 |
|
s|background-image: url('images/line.png'); background-repeat:repeat-y;||g |
397 |
|
s|images/line.png||g' onepage.html > o && mv o onepage.html |
398 |
|
|
399 |
|
rm onepage-tmp.html 2>/dev/null |
400 |
|
|