1 |
#!/bin/bash |
#!/bin/bash |
2 |
########################################################################################################################################## |
############################################################################## |
3 |
|
# |
4 |
|
# update-boot-params, (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 modify |
9 |
|
# it under the terms of the GNU General Public License as published by |
10 |
|
# 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 |
19 |
|
# along with Clonezilla-SysRescCD. If not, see <http://www.gnu.org/licenses/>. |
20 |
|
# |
21 |
|
############################################################################## |
22 |
|
|
23 |
|
|
24 |
|
############################################################################## |
25 |
# |
# |
26 |
# Script to update the boot parameters sections of boor-params.html |
# Script to update the boot parameters sections of boor-params.html |
27 |
# |
# |
28 |
# To be executed BEFORE ../2site script |
# To be executed BEFORE 2site script |
29 |
# |
# |
30 |
# In order to execute this script, type the following command |
# In order to execute this script, type the following command |
31 |
# |
# |
32 |
# . ./update-boot-params |
# ./update-boot-params |
33 |
# |
# |
34 |
# |
# |
35 |
# ** NOTE ** |
# ** NOTE ** |
36 |
# In order to revert to the previous version, execute teh commands: |
# In order to revert to the previous (svn) version, (in case something |
37 |
|
# goes wrong with this script), execute the commands: |
38 |
# rm boot-params.html |
# rm boot-params.html |
39 |
# svn up |
# svn up |
40 |
# |
# |
41 |
|
|
42 |
########################################################################################################################################## |
############################################################################## |
43 |
# Configuration for SystemRescueCD documentation section |
# Configuration for SystemRescueCD documentation section |
44 |
# |
# |
45 |
# This will: |
# This will: |
49 |
# b. add the text from the original site after the line starting with |
# b. add the text from the original site after the line starting with |
50 |
# <!--SysRescCD-Documentation--> ( = tokenStart[0] ) |
# <!--SysRescCD-Documentation--> ( = tokenStart[0] ) |
51 |
# |
# |
52 |
# In order for this to work, inspect the HTML code on page http://www.sysresccd.org/Sysresccd-manual-en_Booting_the_CD-ROM |
# In order for this to work, inspect the HTML code on page |
53 |
# select the starting and ending line of code you want to include in boot-params.html and initialize the variables |
# http://www.sysresccd.org/Sysresccd-manual-en_Booting_the_CD-ROM |
54 |
# startTAG[0] and endTAG[0] accordingly. |
# select the starting and ending line of code you want to include in |
55 |
|
# boot-params.html and initialize the variables startTAG[0] and endTAG[0] |
56 |
|
# accordingly. |
57 |
# |
# |
58 |
# Use variables sectionPrepend[0],sectionAppend[0] to prepend,append any text snippet to the section. |
# Use variables sectionPrepend[0],sectionAppend[0] to prepend,append any text |
59 |
|
# snippet to the section. |
60 |
# Example: |
# Example: |
61 |
# Assumming the documentation section on the original page ends like this |
# Assumming the documentation section on the original page ends like this |
62 |
# <li>A line of text |
# <li>A line of text |
63 |
# </li> |
# </li> |
64 |
# </ul> |
# </ul> |
65 |
# </p> |
# </p> |
66 |
# We set startTAG[0]='<li>A line of text', but this way we also delete the closing TAGS |
# We set startTAG[0]='<li>A line of text', but this way we also delete |
67 |
|
# the closing TAGS |
68 |
# So we set sectionAppend[0]='</li> |
# So we set sectionAppend[0]='</li> |
69 |
# </ul> |
# </ul> |
70 |
# </p>' |
# </p>' |
71 |
# and we get them back |
# and we get them back |
72 |
# |
# |
73 |
# Use name[0] to identify the section, and webPage[0] for the URL of the original documentation |
# Use name[0] to identify the section, and webPage[0] for the URL of the |
74 |
|
# original documentation |
75 |
# |
# |
76 |
# Finally, set sedScript[0] to any specific sed script |
# Finally, set sedScript[0] to any specific sed script |
77 |
# |
# |
78 |
# ** NOTE ** |
# ** NOTE ** |
79 |
# The above scheme can be used for any other documentation section, i.e. SystemRescueCD (profile 1), |
# The above scheme can be used for any other documentation section, i.e. |
80 |
# initramfs manual )profile 2), etc. |
# kernels (profile 1), initramfs manual (profile 2), Clonezilla (profile |
81 |
|
# 3), etc. |
82 |
# |
# |
83 |
# |
# |
84 |
name[0]=SystemRescueCD |
name[0]=SystemRescueCD |
155 |
|
|
156 |
|
|
157 |
|
|
158 |
########################################################################################################################################## |
############################################################################## |
159 |
# funtion to make all happen |
# funtion to make all happen |
160 |
# |
# |
161 |
function updateContent(){ |
function updateContent(){ |
227 |
} |
} |
228 |
|
|
229 |
|
|
230 |
########################################################################################################################################## |
############################################################################## |
231 |
# funtion to download the original web page |
# funtion to download the original web page |
232 |
# |
# |
233 |
function downloadFile(){ |
function downloadFile(){ |
237 |
|
|
238 |
echo " |
echo " |
239 |
Error downloading original web page" |
Error downloading original web page" |
240 |
return 1 |
exit 1 |
241 |
} |
} |
242 |
set +x |
set +x |
243 |
} |
} |
244 |
|
|
245 |
########################################################################################################################################## |
############################################################################## |
246 |
# funtion clean up things when exiting |
# funtion clean up things when exiting |
247 |
# |
# |
248 |
function cleanUp(){ |
function cleanUp(){ |
251 |
|
|
252 |
|
|
253 |
|
|
254 |
########################################################################################################################################## |
############################################################################## |
255 |
# |
# |
256 |
# Script starts here |
# Script starts here |
257 |
# |
# |
258 |
########################################################################################################################################## |
############################################################################## |
259 |
|
cd .. |
260 |
updateContent 0 || { |
updateContent 0 || { |
261 |
cleanUp;return 1 |
cleanUp;exit 1 |
262 |
} |
} |
263 |
updateContent 1 || { |
updateContent 1 || { |
264 |
cleanUp;return 2 |
cleanUp;exit 2 |
265 |
} |
} |
266 |
updateContent 2 || { |
updateContent 2 || { |
267 |
cleanUp;return 3 |
cleanUp;exit 3 |
268 |
} |
} |
269 |
updateContent 3 || { |
updateContent 3 || { |
270 |
cleanUp;return 4 |
cleanUp;exit 4 |
271 |
} |
} |
272 |
|
|
273 |
cleanUp |
cleanUp |