1 |
sng |
39 |
#!/bin/bash |
2 |
|
|
########################################################################################################################################## |
3 |
|
|
# |
4 |
|
|
# Script to update the boot parameters section of boor-params.html |
5 |
|
|
# |
6 |
|
|
# To be executed BEFORE 2site script |
7 |
|
|
# |
8 |
|
|
# In order to execute this script, type the following command |
9 |
|
|
# |
10 |
|
|
# . ./update-boot-params |
11 |
|
|
# |
12 |
|
|
# |
13 |
|
|
# NOTE |
14 |
|
|
# In order to revert to the previous version, execute teh commands: |
15 |
|
|
# rm boot-params.html |
16 |
|
|
# svn up boot-params.html |
17 |
|
|
# |
18 |
|
|
|
19 |
|
|
########################################################################################################################################## |
20 |
|
|
# Configuration for SystemRescueCD documentation section |
21 |
|
|
# |
22 |
|
|
# This will: |
23 |
|
|
# a. remove any text between the line starting with |
24 |
|
|
# <!--SysRescCD-Documentation--> |
25 |
|
|
# and the first </div> TAG |
26 |
|
|
# b. add the text from the original site after the line starting with |
27 |
|
|
# <!--SysRescCD-Documentation--> |
28 |
|
|
# |
29 |
|
|
# In order for this to work, inspect the HTML code on page http://www.sysresccd.org/Sysresccd-manual-en_Booting_the_CD-ROM |
30 |
|
|
# select the starting and ending line of code you want to include in boot-params.html and initialize the variables |
31 |
|
|
# sysStartTAG and sysEndTAG accordingly. **NOTE** : In case the variables' value (text/html code) contains a '/' |
32 |
|
|
# character (used at closing HTML TAGS), replace it with a . character |
33 |
|
|
# Example: "<p>This is a test</p>" would become |
34 |
|
|
# <p>This is a test<.p>" |
35 |
|
|
# |
36 |
|
|
# Use variable sysCloseTAG to add any text snippet to the section. |
37 |
|
|
# Example: |
38 |
|
|
# The documentation section on the original page ends like this |
39 |
|
|
# <li>A line of text |
40 |
|
|
# </li> |
41 |
|
|
# </ul> |
42 |
|
|
# </p> |
43 |
|
|
# We set sysStartTAG='<li>A line of text', but this way we also delete the closing TAGS |
44 |
|
|
# So we set sysCloseTAG='</li> # </ul> |
45 |
|
|
# </p>' |
46 |
|
|
# and we get them back |
47 |
|
|
# |
48 |
|
|
|
49 |
|
|
sysStartTAG='<a name="General_boot_options"' |
50 |
|
|
sysEndTAG='<.li><li><b>ar_nowait<.b>: do not wait for a keypress after the autorun script have been executed.' |
51 |
|
|
sysCloseTAG='</li></ul> |
52 |
|
|
</p>' |
53 |
|
|
########################################################################################################################################## |
54 |
|
|
# Configuration for Clonezilla documentation section |
55 |
|
|
# |
56 |
|
|
# This will: |
57 |
|
|
# a. remove any text between the line starting with |
58 |
|
|
# <!--Clonezilla-Documentation--> |
59 |
|
|
# and the first <hr> TAG |
60 |
|
|
# b. add the text from the original site after the line starting with |
61 |
|
|
# <!--Clonezilla-Documentation--> |
62 |
|
|
# |
63 |
|
|
# In order for this to work, inspect the HTML code on page |
64 |
|
|
# http://clonezilla.org/clonezilla-live/doc/fine-print.php?path=./99_Misc/00_live-initramfs-manual.doc |
65 |
|
|
# select the starting and ending line of code you want to include in boot-params.html and initialize the variables |
66 |
|
|
# clonStartTAG and clonEndTAG accordingly. **NOTE** : In case the variables' value (text/html code) contains a '/' |
67 |
|
|
# character (used at closing HTML TAGS), replace it with a . character |
68 |
|
|
# Example: "<p>This is a test</p>" would become |
69 |
|
|
# <p>This is a test<.p>" |
70 |
|
|
# |
71 |
|
|
# Use variable sysCloseTAG to add any text snippet to the section. |
72 |
|
|
# Example: |
73 |
|
|
# The documentation section on the original page ends like this |
74 |
|
|
# <li>A line of text |
75 |
|
|
# </li> |
76 |
|
|
# </ul> |
77 |
|
|
# </p> |
78 |
|
|
# We set lonStartTAG='<li>A line of text', but this way we also delete the closing TAGS |
79 |
|
|
# So we set lonCloseTAG='</li> # </ul> |
80 |
|
|
# </p>' |
81 |
|
|
# and we get them back |
82 |
|
|
# |
83 |
|
|
|
84 |
|
|
clonStartTAG='Clonezilla live is based on' |
85 |
|
|
clonEndTAG='root file system filesystem.squashfs.' |
86 |
|
|
clonCloseTAG='</ul> |
87 |
|
|
</ol> |
88 |
|
|
' |
89 |
|
|
|
90 |
|
|
|
91 |
|
|
########################################################################################################################################## |
92 |
|
|
# Clonezilla documentation section |
93 |
|
|
# |
94 |
|
|
function updateClonezillaDocumentation(){ |
95 |
|
|
|
96 |
|
|
echo -n "Updating Clonezilla documentation... " |
97 |
|
|
rm 00_live-initramfs-manual.doc 2>/dev/null |
98 |
|
|
wget -q http://clonezilla.org/clonezilla-live/doc/fine-print.php?path=./99_Misc/00_live-initramfs-manual.doc -O 00_live-initramfs-manual.doc || { |
99 |
|
|
echo " |
100 |
|
|
Error downloading 00_live-initramfs-manual.doc" |
101 |
|
|
return 1 |
102 |
|
|
} |
103 |
|
|
|
104 |
|
|
sed -n "/$clonStartTAG/ , /$clonEndTAG/ p" 00_live-initramfs-manual.doc | sed ' |
105 |
|
|
s{<tr>{{g |
106 |
|
|
s{<td[^>]*>{{g |
107 |
|
|
s{<small>{{g |
108 |
|
|
s{<.tr>{{g |
109 |
|
|
s{<.td[^>]*>{{g |
110 |
|
|
1s{^{<div class="otherpage">{ |
111 |
|
|
' > tmp.$$ |
112 |
|
|
if [ -n "$clonCloseTAG" ];then |
113 |
|
|
echo "$clonCloseTAG" >> tmp.$$ |
114 |
|
|
fi |
115 |
|
|
sed '/<!--Clonezilla-Documentation-->/!b |
116 |
|
|
:a |
117 |
|
|
/<hr>/!{ |
118 |
|
|
N |
119 |
|
|
ba |
120 |
|
|
} |
121 |
|
|
s{<!--Clonezilla-Documentation-->.*<hr>{<!--Clonezilla-Documentation-->\n<hr>{' boot-params.html > boot-params-new.html |
122 |
|
|
sed "/<!--Clonezilla-Documentation-->/r tmp.$$" < boot-params-new.html > boot-params.html |
123 |
|
|
|
124 |
|
|
|
125 |
|
|
rm tmp.$$ boot-params-new.html 00_live-initramfs-manual.doc 2>/dev/null |
126 |
|
|
echo 'done' |
127 |
|
|
|
128 |
|
|
} |
129 |
|
|
|
130 |
|
|
########################################################################################################################################## |
131 |
|
|
# SystemRescueCD documentation section |
132 |
|
|
# |
133 |
|
|
function updateSysRescCDDocumentation(){ |
134 |
|
|
echo -n "Updating SysRescCD documentation... " |
135 |
|
|
rm Sysresccd-manual-en_Booting_the_CD-ROM 2>/dev/null |
136 |
|
|
wget -q http://www.sysresccd.org/Sysresccd-manual-en_Booting_the_CD-ROM || { |
137 |
|
|
|
138 |
|
|
echo " |
139 |
|
|
Error downloading Sysresccd-manual-en_Booting_the_CD-ROM" |
140 |
|
|
return 1 |
141 |
|
|
} |
142 |
|
|
sed -n "/$sysStartTAG/ , /$sysEndTAG/ p" Sysresccd-manual-en_Booting_the_CD-ROM | sed ' |
143 |
|
|
s{<h[23]>{<p><b><br>{g |
144 |
|
|
s{<\/h[23]>{</b></p>{g |
145 |
|
|
1s{<p><b><br>{<p><b>{ |
146 |
|
|
s{href="/{href="http://www.sysresccd.org/{g |
147 |
|
|
' > tmp.$$ |
148 |
|
|
|
149 |
|
|
if [ -n "$sysCloseTAG" ];then |
150 |
|
|
echo "$sysCloseTAG" >> tmp.$$ |
151 |
|
|
fi |
152 |
|
|
sed '/<!--SysRescCD-Documentation-->/!b |
153 |
|
|
:a |
154 |
|
|
/<.div>/!{ |
155 |
|
|
N |
156 |
|
|
ba |
157 |
|
|
} |
158 |
|
|
s/<!--SysRescCD-Documentation-->.*<.div>/<!--SysRescCD-Documentation-->\n<\/div>/' boot-params.html > boot-params-new.html |
159 |
|
|
sed "/<!--SysRescCD-Documentation-->/r tmp.$$" < boot-params-new.html > boot-params.html |
160 |
|
|
|
161 |
|
|
rm Sysresccd-manual-en_Booting_the_CD-en_Booting_the_CD-ROM tmp.$$ 2>/dev/null |
162 |
|
|
echo 'done' |
163 |
|
|
|
164 |
|
|
|
165 |
|
|
} |
166 |
|
|
|
167 |
|
|
|
168 |
|
|
|
169 |
|
|
########################################################################################################################################## |
170 |
|
|
# |
171 |
|
|
# Script starts here |
172 |
|
|
# |
173 |
|
|
########################################################################################################################################## |
174 |
|
|
|
175 |
|
|
updateSysRescCDDocumentation || return |
176 |
|
|
updateClonezillaDocumentation || return |
177 |
|
|
|