--- trunk/www/2site 2010/03/17 23:46:34 28 +++ trunk/www/working/scripts/2site 2010/05/19 11:49:25 44 @@ -1,23 +1,49 @@ #!/bin/bash -echo 'Creating files' -echo -n " template.html... " -myDate=`sed -n '1p' working/release-data ` -myVersion=`sed -n '2p' working/release-data ` -thisDate=`date '+%d/%m/%Y'` +#################################################################################### +# +# 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 . +# +#################################################################################### +#################################################################################### +# Configuration section +# +# Set whereIsTheISO to the location of current Clonezilla-SysRescCD ISO file +# Set whereIsTheTarBall to the location of current Clonezilla-SysRescCD TGZ file whereIsTheISO=/e/clonezilla-sysresccd-full-mod-"$myVersion"/clonezilla-sysresccd-full-mod-"$myVersion".iso whereIsTheISO=/e/clonezilla-sysresccd-full-mod-"$myVersion".iso whereIsTheTarBall=/home/spiros/multibootcd/create-clonezilla-sysresccd-"$myVersion".tar.gz -# . "$HOME/.2site.conf" -[ -e "$whereIsTheISO" ] && isoSize=$(du -h "$whereIsTheISO" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|') || { - echo " Error: The variable \"whereIsTheISO\" is invalid - Please edit your ~/.2site.conf file" -# exit 1 -} +#################################################################################### + +#################################################################################### +# Script starts here # +#################################################################################### +cd .. +cd .. +echo 'Creating files' +echo -n " template.html... " +myDate=`sed -n '1p' working/release-data ` +myVersion=`sed -n '2p' working/release-data ` +thisDate=`date '+%d/%m/%Y'` md5sum="$(echo "$whereIsTheISO" | sed 's|/[^/]*$|/md5sum.txt|')" md5sum="$(cat "$md5sum")" @@ -30,9 +56,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 +74,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 +91,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 +111,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 +140,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 +208,11 @@ -# #Fix doc.html - Documentation menu +############################################################################# +# # +# Fix doc.html - Documentation menu # +# # +############################################################################# # num=`grep -n '<div id="linkline">' doc.html | sed 's|:.*||'` # # ' @@ -191,24 +227,44 @@ echo 'Fixing documentation files' count=0 -for n in project.html \ - custom-cd.html \ - usb.html \ - boot-params.html \ - clonezilla.html \ - backup.html \ - backup-smb.html \ - restoration.html \ - restore.html \ - restore-burn.html \ - reloc-img.html \ - supergrubdisk.html \ - oldboot.html \ - sysresccd.html \ - partitions.html \ - recover.html \ - own-scripts.html \ - annex-a-devices.html + + +# for n in project.html \ +# custom-cd.html \ +# usb.html \ +# boot-params.html \ +# clonezilla.html \ +# backup.html \ +# backup-smb.html \ +# restoration.html \ +# restore.html \ +# restore-burn.html \ +# reloc-img.html \ +# supergrubdisk.html \ +# oldboot.html \ +# sysresccd.html \ +# partitions.html \ +# recover.html \ +# own-scripts.html \ +# annex-a-devices.html + +theFiles="usb.html +boot-params.html +clonezilla.html +backup.html +backup-smb.html +restoration.html +restore.html +restore-burn.html +reloc-img.html +supergrubdisk.html +oldboot.html +sysresccd.html +partitions.html +recover.html +own-scripts.html +annex-a-devices.html" +for n in $theFiles do html[count]="$n" ((count++)) @@ -257,7 +313,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]>|| @@ -294,3 +354,51 @@ rm *~ list template.html 2>/dev/null + +############################################################################# +# # +# Creating onepage.html # +# # +############################################################################# + +echo "Creating onepage.html" + + + +sed '1,/<div id="menu">/!d +/<div id="menu">/d +s|<!--.*-->||g +s/margin-top: 0;/margin-top: 0; font-size: 2em;/ +/^$/d' < index.html | sed '$d' > onepage.html + + +rm onepage-tmp.html 2>/dev/null +# exit +#for n in doc.html $theFiles +for n in $theFiles screenshots.html help.html +do +echo -n " $n... " +title=`sed '/<[tT][iI][tT][lL][eE]>/!d +s|<[^>]*>||g +s|Documentation: || +s|Clonezilla-SysRescCD - ||' "$n"` + +sed '1,/<div id="content">/d +/<div id="menu">/,$d +/<div id="footer">/,$d' "$n" | sed "s|</[aA]>Intro|</a>$title| +/<H2 style=\"margin-top: 0;\">/s|margin-top: 0;|font-size: 2em;| +s|<!--.*-->||g +/^$/d" | sed '$d' >> onepage-tmp.html +echo 'done' +done + +cat onepage-tmp.html >> onepage.html +echo '</div>' >> onepage.html +sed '/<div id="menu">/,$!d' index.html |sed '/<div id="menu">/,/<.div>/d' >> onepage.html + +sed '/#content/s/width: 750px;/width: 950px;/ +s|background-image: url('images/line.png'); background-repeat:repeat-y;||g +s|images/line.png||g' onepage.html > o && mv o onepage.html + +rm onepage-tmp.html 2>/dev/null +