/[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 28 by sng, Wed Mar 17 23:46:34 2010 UTC trunk/www/working/scripts/2site revision 49 by sng, Thu May 20 15:43:26 2010 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  echo 'Creating files'  ##############################################################################
3  echo -n "  template.html...   "  #                                                                            #
4  myDate=`sed -n '1p' working/release-data `  # 2site, (C) 2007-2010 S. Georgaras <sng@hellug.gr>                          #
5  myVersion=`sed -n '2p' working/release-data `  #                                                                            #
6  thisDate=`date '+%d/%m/%Y'`  # 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-full-mod-"$myVersion"/clonezilla-sysresccd-full-mod-"$myVersion".iso  whereIsTheISO=/e/clonezilla-sysresccd-full-mod-"$myVersion"/clonezilla-sysresccd-full-mod-"$myVersion".iso
30  whereIsTheISO=/e/clonezilla-sysresccd-full-mod-"$myVersion".iso  whereIsTheISO=/e/clonezilla-sysresccd-full-mod-"$myVersion".iso
31    
32  whereIsTheTarBall=/home/spiros/multibootcd/create-clonezilla-sysresccd-"$myVersion".tar.gz  whereIsTheTarBall=/home/spiros/multibootcd/create-clonezilla-sysresccd-"$myVersion".tar.gz
33    
34  # . "$HOME/.2site.conf"  ##############################################################################
35  [ -e "$whereIsTheISO" ] && isoSize=$(du -h "$whereIsTheISO" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|') || {  #                             Script starts here                             #
36    echo "    Error: The variable \"whereIsTheISO\" is invalid  ##############################################################################
37                     Please edit your ~/.2site.conf file"  
38  #   exit 1  # Go to www/ directory
39  }  cd ..
40    cd ..
41    echo 'Creating files'
42    echo -n "  template.html...   "
43    myDate=`sed -n '1p' working/release-data `
44    myVersion=`sed -n '2p' working/release-data `
45    thisDate=`date '+%d/%m/%Y'`
46  md5sum="$(echo "$whereIsTheISO" | sed 's|/[^/]*$|/md5sum.txt|')"  md5sum="$(echo "$whereIsTheISO" | sed 's|/[^/]*$|/md5sum.txt|')"
47  md5sum="$(cat "$md5sum")"  md5sum="$(cat "$md5sum")"
48    
# Line 30  tarballSizeEN=$(echo "$tarballSize" | se Line 55  tarballSizeEN=$(echo "$tarballSize" | se
55    
56    
57    
58  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.$$
59    
60  rm ~/tmp/aai.$$ 2>/dev/null  rm /tmp/aai.$$ 2>/dev/null
61  while read line;do  while read line;do
62  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|
63  s|Feb|02|  s|Feb|02|
# Line 48  s|Nov|11| Line 73  s|Nov|11|
73  s|Dec|12|  s|Dec|12|
74  ')"  ')"
75  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>||')"
76  echo "$dt - $tit" | grep '^[0-9]' >> ~/tmp/aai.$$  echo "$dt - $tit" | grep '^[0-9]' >> /tmp/aai.$$
77  done < ~/tmp/iaa.$$  done < /tmp/iaa.$$
78  rm ~/tmp/iaa.$$  rm /tmp/iaa.$$
79    
80  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|$| \\|')"
81    
82    
83    
84  rm ~/tmp/aai.$$  rm /tmp/aai.$$
85    
86  sed "/<H1[^>]*>What's New<.H1>/a \  sed "/<H1[^>]*>What's New<.H1>/a \
87  $l  $l
88  " .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
89    
90    
91  echo 'done'  echo 'done'
92    
93  #  #############################################################################
94  # Create news.php  #                                                                           #
95  #  #                              Create news.php                              #
96    #                                                                           #
97    #############################################################################
98    
99  echo -n '  news.php...   '  echo -n '  news.php...   '
100  sed -n '1,/<div id="content">/p' template.html > 1.$$  sed -n '1,/<div id="content">/p' template.html > 1.$$
101  cat .news.php >> 1.$$  cat working/.news.php >> 1.$$
102  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.$$
103    
104  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 110  s|\"myTitle\"|What's New|
110  echo 'done'  echo 'done'
111    
112    
113  #  #############################################################################
114  # Create 404.html  #                                                                           #
115  #  #                               Create 404.html                             #
116    #                                                                           #
117    #############################################################################
118  echo -n '  404.html...   '  echo -n '  404.html...   '
119  sed -n '1,/<div id="content">/p' template.html > 1.$$  sed -n '1,/<div id="content">/p' template.html > 1.$$
120  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 126  s|#content { float: left;|#content { |
126  rm 1.$$  rm 1.$$
127    
128  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.$$
129  sed -n '1,/<!--seperator-->/p' .404.html >> p1.$$  sed -n '1,/<!--seperator-->/p' working/.404.html >> p1.$$
130  sed -n '/<.[hH][eE][aA][dD]>/,$p' xxx.html >> p1.$$  sed -n '/<.[hH][eE][aA][dD]>/,$p' xxx.html >> p1.$$
131  mv p1.$$ xxx.html  mv p1.$$ xxx.html
132    
133  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.$$
134  sed '1,/<!--seperator-->/d' .404.html >> p1.$$  sed '1,/<!--seperator-->/d' working/.404.html >> p1.$$
135  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.$$
136  sed '/<!--seperator-->/d' p1.$$ > 404.html  sed '/<!--seperator-->/d' p1.$$ > 404.html
137  rm *.$$ xxx.html  rm *.$$ xxx.html
# Line 110  echo 'done' Line 139  echo 'done'
139    
140    
141    
142  #  #############################################################################
143  # Create files (main menu)  #                                                                           #
144  #  #                         Create files (main menu)                          #
145    #                                                                           #
146    #############################################################################
147  # 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
148  echo 'Creating menu files'  echo 'Creating menu files'
149  # 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 176  done Line 207  done
207    
208    
209    
210  # #Fix doc.html - Documentation menu  #############################################################################
211    #                                                                           #
212    #                    Fix doc.html - Documentation menu                      #
213    #                                                                           #
214    #############################################################################
215  # num=`grep -n  '<div id="linkline">' doc.html | sed 's|:.*||'`  # num=`grep -n  '<div id="linkline">' doc.html | sed 's|:.*||'`
216  #  #
217  # '  # '
# Line 191  echo '<H2 style="margin-top: 0;">Content Line 226  echo '<H2 style="margin-top: 0;">Content
226  echo 'Fixing documentation files'  echo 'Fixing documentation files'
227  count=0  count=0
228    
229  for n in project.html \  
230    custom-cd.html \  
231    usb.html \  # for n in project.html \
232    boot-params.html \  #   custom-cd.html \
233    clonezilla.html \  #   usb.html \
234    backup.html \  #   boot-params.html \
235    backup-smb.html \  #   clonezilla.html \
236    restoration.html \  #   backup.html \
237    restore.html \  #   backup-smb.html \
238    restore-burn.html \  #   restoration.html \
239    reloc-img.html \  #   restore.html \
240    supergrubdisk.html \  #   restore-burn.html \
241    oldboot.html \  #   reloc-img.html \
242    sysresccd.html \  #   supergrubdisk.html \
243    partitions.html \  #   oldboot.html \
244    recover.html \  #   sysresccd.html \
245    own-scripts.html \  #   partitions.html \
246    annex-a-devices.html  #   recover.html \
247    #   own-scripts.html \
248    #   annex-a-devices.html
249    
250    theFiles="usb.html
251    boot-params.html
252    clonezilla.html
253    backup.html
254    backup-smb.html
255    restoration.html
256    restore.html
257    restore-burn.html
258    reloc-img.html
259    supergrubdisk.html
260    oldboot.html
261    sysresccd.html
262    partitions.html
263    recover.html
264    own-scripts.html
265    annex-a-devices.html"
266    for n in $theFiles
267  do  do
268          html[count]="$n"          html[count]="$n"
269          ((count++))          ((count++))
# Line 257  sed "/<!-- docline-top-->/a \ Line 312  sed "/<!-- docline-top-->/a \
312    
313    
314    
315  # contents list for doc.html  #############################################################################
316    #                                                                           #
317    #                       contents list for doc.html                          #
318    #                                                                           #
319    #############################################################################
320  sed -n '/<[Hh][23]/p' "$n" | sed "1d  sed -n '/<[Hh][23]/p' "$n" | sed "1d
321  /<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d  /<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d
322  s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>||  s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>||
# Line 294  s|\"myTitle\"|Documentation|g'> doc.html Line 353  s|\"myTitle\"|Documentation|g'> doc.html
353  rm *~  list template.html 2>/dev/null  rm *~  list template.html 2>/dev/null
354    
355    
356    
357    #############################################################################
358    #                                                                           #
359    #                          Creating onepage.html                            #
360    #                                                                           #
361    #############################################################################
362    
363    echo "Creating onepage.html"
364    
365    
366    
367    sed '1,/<div id="menu">/!d
368    /<div id="menu">/d
369    s|<!--.*-->||g
370    s/margin-top: 0;/margin-top: 0; font-size: 2em;/
371    /^$/d' < index.html | sed '$d' > onepage.html
372    
373    
374    rm onepage-tmp.html 2>/dev/null
375    # exit
376    #for n in doc.html $theFiles
377    for n in $theFiles screenshots.html help.html
378    do
379    echo -n "  $n...   "
380    title=`sed '/<[tT][iI][tT][lL][eE]>/!d
381    s|<[^>]*>||g
382    s|Documentation: ||
383    s|Clonezilla-SysRescCD - ||' "$n"`
384    
385    sed '1,/<div id="content">/d
386    /<div id="menu">/,$d
387    /<div id="footer">/,$d' "$n" | sed "s|</[aA]>Intro|</a>$title|
388    /<H2 style=\"margin-top: 0;\">/s|margin-top: 0;|font-size: 2em;|
389    s|<!--.*-->||g
390    /^$/d" |  sed '$d' >> onepage-tmp.html
391    echo 'done'
392    done
393    
394    cat onepage-tmp.html >> onepage.html
395    echo '</div>' >> onepage.html
396    sed '/<div id="menu">/,$!d' index.html |sed '/<div id="menu">/,/<.div>/d' >> onepage.html
397    
398    sed '/#content/s/width: 750px;/width: 950px;/
399    s|background-image: url('images/line.png'); background-repeat:repeat-y;||g
400    s|images/line.png||g' onepage.html > o && mv o onepage.html
401    
402    rm onepage-tmp.html 2>/dev/null
403    

Legend:
Removed from v.28  
changed lines
  Added in v.49

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26