/[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

revision 42 by sng, Tue May 18 14:22:00 2010 UTC revision 121 by sng, Thu Sep 16 11:30:36 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    pushd "$PWD"
24    ##############################################################################
25    # Configuration section
26  #  #
27  # 2site, (C) 2007-2010 S. Georgaras <sng@hellug.gr>  # Set whereIsTheISO to the location of current Clonezilla-SysRescCD ISO file
28  #  # Set whereIsTheTarBall to the location of current Clonezilla-SysRescCD TGZ file
29  # This file is part of Clonezilla-SysRescCD.  whereIsTheISO=/e/clonezilla-sysresccd-"$myVersion"
30  #  
31  # Clonezilla-SysRescCD is free software: you can redistribute it and/or modify  ##############################################################################
32  # it under the terms of the GNU General Public License as published by  #                             Script starts here                             #
33  # the Free Software Foundation, either version 2 of the License, or  ##############################################################################
34  # (at your option) any later version.  while getopts "d:n" Option
35  #  do
36  # Clonezilla-SysRescCD is distributed in the hope that it will be useful,   case $Option in
37  # but WITHOUT ANY WARRANTY; without even the implied warranty of   d) thisDate="$OPTARG"
38  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   ;;
39  # GNU General Public License for more details.   n) noDoc=1;;
40  #    esac
41  # You should have received a copy of the GNU General Public License  done
42  # along with Clonezilla-SysRescCD. If not, see <http://www.gnu.org/licenses/>.  ./pack-them
43  #  
44  ####################################################################################  
45    # Go to www/ directory
46  cd ..  cd ..
47  cd ..  cd ..
48  echo 'Creating files'  echo 'Creating files'
49  echo -n "  template.html...   "  echo -n "  template.html...   "
50  myDate=`sed -n '1p' working/release-data `  myDate=`sed -n '1p' working/release-data `
51  myVersion=`sed -n '2p' working/release-data `  myVersion=`sed -n '2p' working/release-data `
52  thisDate=`date '+%d/%m/%Y'`  if [ -z "$thisDate" ];then
53      thisDate=`date '+%d/%m/%Y'`
54    fi
 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  
 }  
55    
56  md5sum="$(echo "$whereIsTheISO" | sed 's|/[^/]*$|/md5sum.txt|')"  whereIsTheISO="$whereIsTheISO""$myVersion"
57  md5sum="$(cat "$md5sum")"  whereIsTheTarBall="$whereIsTheISO"/create-clonezilla-sysresccd-"$myVersion".tar.gz
58    ISO_I686_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-i686-"$myVersion"/clonezilla-sysresccd-i686-"$myVersion".iso | sed 's|[ \t].*||'`
59    ISO_I686_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-i686-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'`
60    ISO_AMD64_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-amd64-"$myVersion"/clonezilla-sysresccd-amd64-"$myVersion".iso | sed 's|[ \t].*||'`
61    ISO_AMD64_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-amd64-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'`
62    ISO_I486_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-i486-"$myVersion"/clonezilla-sysresccd-i486-"$myVersion".iso | sed 's|[ \t].*||'`
63    ISO_I486_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-i486-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'`
64    
65  tarballSize=$(du -h "$whereIsTheTarBall" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|')  tarballSize=$(du -h "$whereIsTheTarBall" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|')
66  isoSizeEN=$(echo "$isoSize" | sed 's|,|.|')  isoSizeEN=$(echo "$isoSize" | sed 's|,|.|')
# Line 51  tarballSizeEN=$(echo "$tarballSize" | se Line 70  tarballSizeEN=$(echo "$tarballSize" | se
70    
71    
72    
   
73  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.$$
74    
75  rm /tmp/aai.$$ 2>/dev/null  rm /tmp/aai.$$ 2>/dev/null
# Line 82  rm /tmp/aai.$$ Line 100  rm /tmp/aai.$$
100    
101  sed "/<H1[^>]*>What's New<.H1>/a \  sed "/<H1[^>]*>What's New<.H1>/a \
102  $l  $l
103  " .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
104    
105    
106  echo 'done'  echo 'done'
107    
108    
109  #############################################################################  #############################################################################
110  #                                                                           #  #                                                                           #
111  #                              Create news.php                              #  #                              Create news.php                              #
# Line 95  echo 'done' Line 114  echo 'done'
114    
115  echo -n '  news.php...   '  echo -n '  news.php...   '
116  sed -n '1,/<div id="content">/p' template.html > 1.$$  sed -n '1,/<div id="content">/p' template.html > 1.$$
117  cat .news.php >> 1.$$  cat working/.news.php >> 1.$$
118  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.$$
119    
120  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 123  s|#content { float: left;|#content { | Line 142  s|#content { float: left;|#content { |
142  rm 1.$$  rm 1.$$
143    
144  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.$$
145  sed -n '1,/<!--seperator-->/p' .404.html >> p1.$$  sed -n '1,/<!--seperator-->/p' working/.404.html >> p1.$$
146  sed -n '/<.[hH][eE][aA][dD]>/,$p' xxx.html >> p1.$$  sed -n '/<.[hH][eE][aA][dD]>/,$p' xxx.html >> p1.$$
147  mv p1.$$ xxx.html  mv p1.$$ xxx.html
148    
149  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.$$
150  sed '1,/<!--seperator-->/d' .404.html >> p1.$$  sed '1,/<!--seperator-->/d' working/.404.html >> p1.$$
151  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.$$
152  sed '/<!--seperator-->/d' p1.$$ > 404.html  sed '/<!--seperator-->/d' p1.$$ | sed "s|myVersion|"$myVersion"|g" > 404.html
153  rm *.$$ xxx.html  rm *.$$ xxx.html
154  echo 'done'  echo 'done'
155    
# Line 189  sed '/<!--txt-only-->/!b Line 208  sed '/<!--txt-only-->/!b
208  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|
209  s|\"myVersion\"|$myVersion|g  s|\"myVersion\"|$myVersion|g
210  s|TARBALL_SIZE|$tarballSizeEN|g  s|TARBALL_SIZE|$tarballSizeEN|g
211  s|ISO_SIZE|$isoSizeEN|g  
212  s|\"MD5SUM\"|$md5sum|  s{ISO_I686_SIZE{$ISO_I686_SIZE{g
213    s{ISO_I686_MD5{$ISO_I686_MD5{g
214    s{ISO_I486_SIZE{$ISO_I486_SIZE{g
215    s{ISO_I486_MD5{$ISO_I486_MD5{g
216    s{ISO_AMD64_SIZE{$ISO_AMD64_SIZE{g
217    s{ISO_AMD64_MD5{$ISO_AMD64_MD5{g
218    
219  /<[hH]1>.*<[bB][rR]/d  /<[hH]1>.*<[bB][rR]/d
220  s|class=\"here\" ||  s|class=\"here\" ||
221  s|<a href=\"$fonly\">|<a class=\"here\" href=\"$fonly\">|  s|<a href=\"$fonly\">|<a class=\"here\" href=\"$fonly\">|
# Line 398  s|images/line.png||g' onepage.html > o & Line 423  s|images/line.png||g' onepage.html > o &
423    
424  rm onepage-tmp.html 2>/dev/null  rm onepage-tmp.html 2>/dev/null
425    
426    
427    
428    #############################################################################
429    #                                                                           #
430    #                    Fix download.html warning versions                     #
431    #                                                                           #
432    #############################################################################
433    verLineIndex=`grep bordertable index.html | grep "$myversion"|  grep '[0-9][0-9]*/[0-9][0-9]/[0-9][0-9]'     |sed "s|.*"$myVersion"||" | sed 's/"]//g' | sed -n '1p'`
434    
435    
436    CLONEZILLA_VERSION=`echo "$verLineIndex" | sed 's|.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*-[0-9][0-9]*\).*|\1|'`
437    verLineIndex=`echo "$verLineIndex" | sed "s|.*$CLONEZILLA_VERSION||"`
438    SYSRESCCD_VERSION=`echo "$verLineIndex" | sed 's|.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|'`
439    sed "
440    s/CLONEZILLA_VERSION/$CLONEZILLA_VERSION/
441    s/SYSRESCCD_VERSION/$SYSRESCCD_VERSION/
442    " download.html > download.html.$$ && mv download.html.$$ download.html
443    
444    popd
445    if [ -z "$noDoc" ];then
446      ./html2doc
447      ./html2txt
448    fi
449    

Legend:
Removed from v.42  
changed lines
  Added in v.121

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26