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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/www/2site revision 37 by sng, Tue Mar 23 10:28:53 2010 UTC trunk/www/working/scripts/2site revision 99 by sng, Mon Aug 16 13:00:26 2010 UTC
# Line 1  Line 1 
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      #
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    
23    
24    ##############################################################################
25    # 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    whereIsTheISO=/e/clonezilla-sysresccd-"$myVersion"
30    
31    ##############################################################################
32    #                             Script starts here                             #
33    ##############################################################################
34    
35    # Go to www/ directory
36    cd ..
37    cd ..
38  echo 'Creating files'  echo 'Creating files'
39  echo -n "  template.html...   "  echo -n "  template.html...   "
40  myDate=`sed -n '1p' working/release-data `  myDate=`sed -n '1p' working/release-data `
41  myVersion=`sed -n '2p' working/release-data `  myVersion=`sed -n '2p' working/release-data `
42  thisDate=`date '+%d/%m/%Y'`  thisDate=`date '+%d/%m/%Y'`
43    
44    whereIsTheISO="$whereIsTheISO""$myVersion"
45  whereIsTheISO=/e/clonezilla-sysresccd-full-mod-"$myVersion"/clonezilla-sysresccd-full-mod-"$myVersion".iso  whereIsTheTarBall="$whereIsTheISO"/create-clonezilla-sysresccd-"$myVersion".tar.gz
46  whereIsTheISO=/e/clonezilla-sysresccd-full-mod-"$myVersion".iso  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  whereIsTheTarBall=/home/spiros/multibootcd/create-clonezilla-sysresccd-"$myVersion".tar.gz  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  # . "$HOME/.2site.conf"  ISO_I486_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-i486-"$myVersion"/clonezilla-sysresccd-i486-"$myVersion".iso | sed 's|[ \t].*||'`
51  [ -e "$whereIsTheISO" ] && isoSize=$(du -h "$whereIsTheISO" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|') || {  ISO_I486_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-i486-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'`
   echo "    Error: The variable \"whereIsTheISO\" is invalid  
                    Please edit your ~/.2site.conf file"  
 #   exit 1  
 }  
   
 md5sum="$(echo "$whereIsTheISO" | sed 's|/[^/]*$|/md5sum.txt|')"  
 md5sum="$(cat "$md5sum")"  
52    
53  tarballSize=$(du -h "$whereIsTheTarBall" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|')  tarballSize=$(du -h "$whereIsTheTarBall" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|')
54  isoSizeEN=$(echo "$isoSize" | sed 's|,|.|')  isoSizeEN=$(echo "$isoSize" | sed 's|,|.|')
# Line 29  tarballSizeEN=$(echo "$tarballSize" | se Line 58  tarballSizeEN=$(echo "$tarballSize" | se
58    
59    
60    
61    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    
63  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  
64  while read line;do  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|  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|  s|Feb|02|
# Line 48  s|Nov|11| Line 76  s|Nov|11|
76  s|Dec|12|  s|Dec|12|
77  ')"  ')"
78  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>||')"
79  echo "$dt - $tit" | grep '^[0-9]' >> ~/tmp/aai.$$  echo "$dt - $tit" | grep '^[0-9]' >> /tmp/aai.$$
80  done < ~/tmp/iaa.$$  done < /tmp/iaa.$$
81  rm ~/tmp/iaa.$$  rm /tmp/iaa.$$
82    
83  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|$| \\|')"
84    
85    
86    
87  rm ~/tmp/aai.$$  rm /tmp/aai.$$
88    
89  sed "/<H1[^>]*>What's New<.H1>/a \  sed "/<H1[^>]*>What's New<.H1>/a \
90  $l  $l
91  " .template.html | sed "s|\"myDate\"|$myDate|" | sed "s|\"myVersion\"|$myVersion|g" | sed "s|Last update: [^<]*<|Last update: $thisDate<|" > template.html  " working/.template.html | sed "s|\"myDate\"|$myDate|" | sed "s|\"myVersion\"|$myVersion|g" | sed "s|Last update: [^<]*<|Last update: $thisDate<|" > template.html
92    
93    
94  echo 'done'  echo 'done'
95    
96  #  #############################################################################
97  # Create news.php  #                                                                           #
98  #  #                              Create news.php                              #
99    #                                                                           #
100    #############################################################################
101    
102  echo -n '  news.php...   '  echo -n '  news.php...   '
103  sed -n '1,/<div id="content">/p' template.html > 1.$$  sed -n '1,/<div id="content">/p' template.html > 1.$$
104  cat .news.php >> 1.$$  cat working/.news.php >> 1.$$
105  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.$$
106    
107  sed '/#content/s/width: 750px;/width: 950px/' 1.$$ | sed "s|background-image: url('images/line.png'); background-repeat:repeat-y;||  sed '/#content/s/width: 750px;/width: 950px/' 1.$$ | sed "s|background-image: url('images/line.png'); background-repeat:repeat-y;||
# Line 83  s|\"myTitle\"|What's New| Line 113  s|\"myTitle\"|What's New|
113  echo 'done'  echo 'done'
114    
115    
116  #  #############################################################################
117  # Create 404.html  #                                                                           #
118  #  #                               Create 404.html                             #
119    #                                                                           #
120    #############################################################################
121  echo -n '  404.html...   '  echo -n '  404.html...   '
122  sed -n '1,/<div id="content">/p' template.html > 1.$$  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.$$  sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d'  >> 1.$$
# Line 97  s|#content { float: left;|#content { | Line 129  s|#content { float: left;|#content { |
129  rm 1.$$  rm 1.$$
130    
131  sed -n '1,/<.[hH][eE][aA][dD]>/p' xxx.html | sed '$d' > p1.$$  sed -n '1,/<.[hH][eE][aA][dD]>/p' xxx.html | sed '$d' > p1.$$
132  sed -n '1,/<!--seperator-->/p' .404.html >> p1.$$  sed -n '1,/<!--seperator-->/p' working/.404.html >> p1.$$
133  sed -n '/<.[hH][eE][aA][dD]>/,$p' xxx.html >> p1.$$  sed -n '/<.[hH][eE][aA][dD]>/,$p' xxx.html >> p1.$$
134  mv p1.$$ xxx.html  mv p1.$$ xxx.html
135    
136  sed -n '1,/<[dD][iI][vV] [iI][dD]="content">/p' xxx.html> p1.$$  sed -n '1,/<[dD][iI][vV] [iI][dD]="content">/p' xxx.html> p1.$$
137  sed '1,/<!--seperator-->/d' .404.html >> p1.$$  sed '1,/<!--seperator-->/d' working/.404.html >> p1.$$
138  sed -n '/<[dD][iI][vV] [iI][dD]="content">/,$p' xxx.html | sed '1d'  >> p1.$$  sed -n '/<[dD][iI][vV] [iI][dD]="content">/,$p' xxx.html | sed '1d'  >> p1.$$
139  sed '/<!--seperator-->/d' p1.$$ > 404.html  sed '/<!--seperator-->/d' p1.$$ > 404.html
140  rm *.$$ xxx.html  rm *.$$ xxx.html
# Line 110  echo 'done' Line 142  echo 'done'
142    
143    
144    
145  #  #############################################################################
146  # Create files (main menu)  #                                                                           #
147  #  #                         Create files (main menu)                          #
148    #                                                                           #
149    #############################################################################
150  # 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
151  echo 'Creating menu files'  echo 'Creating menu files'
152  # for n in index.html screenshots.html help.html doc.html;do  # for n in index.html screenshots.html help.html doc.html;do
# Line 161  sed '/<!--txt-only-->/!b Line 195  sed '/<!--txt-only-->/!b
195  s/<!--txt-only-->.*<!--end-txt-only-->//' tpm.$$ | sed 's| $||'  | sed "s|\"myTitle\"|$myTitle|  s/<!--txt-only-->.*<!--end-txt-only-->//' tpm.$$ | sed 's| $||'  | sed "s|\"myTitle\"|$myTitle|
196  s|\"myVersion\"|$myVersion|g  s|\"myVersion\"|$myVersion|g
197  s|TARBALL_SIZE|$tarballSizeEN|g  s|TARBALL_SIZE|$tarballSizeEN|g
198  s|ISO_SIZE|$isoSizeEN|g  
199  s|\"MD5SUM\"|$md5sum|  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  /<[hH]1>.*<[bB][rR]/d  /<[hH]1>.*<[bB][rR]/d
207  s|class=\"here\" ||  s|class=\"here\" ||
208  s|<a href=\"$fonly\">|<a class=\"here\" href=\"$fonly\">|  s|<a href=\"$fonly\">|<a class=\"here\" href=\"$fonly\">|
# Line 176  done Line 216  done
216    
217    
218    
219  # #Fix doc.html - Documentation menu  #############################################################################
220    #                                                                           #
221    #                    Fix doc.html - Documentation menu                      #
222    #                                                                           #
223    #############################################################################
224  # num=`grep -n  '<div id="linkline">' doc.html | sed 's|:.*||'`  # num=`grep -n  '<div id="linkline">' doc.html | sed 's|:.*||'`
225  #  #
226  # '  # '
# Line 277  sed "/<!-- docline-top-->/a \ Line 321  sed "/<!-- docline-top-->/a \
321    
322    
323    
324  # contents list for doc.html  #############################################################################
325    #                                                                           #
326    #                       contents list for doc.html                          #
327    #                                                                           #
328    #############################################################################
329  sed -n '/<[Hh][23]/p' "$n" | sed "1d  sed -n '/<[Hh][23]/p' "$n" | sed "1d
330  /<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d  /<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d
331  s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>||  s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>||

Legend:
Removed from v.37  
changed lines
  Added in v.99

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26