--- trunk/www/2site 2010/05/17 23:45:40 41 +++ trunk/www/working/scripts/2site 2010/05/18 14:22:00 42 @@ -1,4 +1,26 @@ #!/bin/bash +#################################################################################### +# +# 2site, (C) 2007-2010 S. Georgaras +# +# This file is part of Clonezilla-SysRescCD. +# +# Clonezilla-SysRescCD is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# Clonezilla-SysRescCD is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Clonezilla-SysRescCD. If not, see . +# +#################################################################################### +cd .. +cd .. echo 'Creating files' echo -n " template.html... " myDate=`sed -n '1p' working/release-data ` @@ -30,9 +52,9 @@ -tr -d '\n' < working/clonezilla-sysresccd.rss | sed 's|<[tT][iI][tT][lL][eE]>|\n|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.$$ -rm ~/tmp/aai.$$ 2>/dev/null +rm /tmp/aai.$$ 2>/dev/null while read line;do 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| s|Feb|02| @@ -48,15 +70,15 @@ s|Dec|12| ')" tit="$(echo "$line" | sed 's|</[Tt][iI][tT][lL][eE]>.*||' | sed 's|<title>||')" -echo "$dt - $tit" | grep '^[0-9]' >> ~/tmp/aai.$$ -done < ~/tmp/iaa.$$ -rm ~/tmp/iaa.$$ +echo "$dt - $tit" | grep '^[0-9]' >> /tmp/aai.$$ +done < /tmp/iaa.$$ +rm /tmp/iaa.$$ -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|$| \\|')" -rm ~/tmp/aai.$$ +rm /tmp/aai.$$ sed "/<H1[^>]*>What's New<.H1>/a \ $l @@ -65,9 +87,11 @@ echo 'done' -# -# Create news.php -# +############################################################################# +# # +# Create news.php # +# # +############################################################################# echo -n ' news.php... ' sed -n '1,/<div id="content">/p' template.html > 1.$$ @@ -83,9 +107,11 @@ echo 'done' -# -# Create 404.html -# +############################################################################# +# # +# Create 404.html # +# # +############################################################################# echo -n ' 404.html... ' sed -n '1,/<div id="content">/p' template.html > 1.$$ sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$ @@ -110,9 +136,11 @@ -# -# Create files (main menu) -# +############################################################################# +# # +# Create files (main menu) # +# # +############################################################################# # for n in index.html features.html doc.html download.html screenshots.html credits.html links.html;do echo 'Creating menu files' # for n in index.html screenshots.html help.html doc.html;do @@ -176,7 +204,11 @@ -# #Fix doc.html - Documentation menu +############################################################################# +# # +# Fix doc.html - Documentation menu # +# # +############################################################################# # num=`grep -n '<div id="linkline">' doc.html | sed 's|:.*||'` # # ' @@ -277,7 +309,11 @@ -# contents list for doc.html +############################################################################# +# # +# contents list for doc.html # +# # +############################################################################# sed -n '/<[Hh][23]/p' "$n" | sed "1d /<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>||