Skip to content

Commit 9ce76dd

Browse files
committed
Move the content of redirect.html into a schema styled file, that while hostname is changed, the redirect can be properly generated (or the style exchanged during modfication)
1 parent 8a45fae commit 9ce76dd

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

piratebox_origin/piratebox/piratebox/bin/install_piratebox.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,14 @@ fi
153153

154154
set_Hostname() {
155155
local name=$1 ; shift;
156-
echo "
157-
<html>
158-
<head><title>Redirect...</title>
159-
<meta http-equiv='refresh' content='0;url=http://$1/' />
160-
<meta http-equiv='cache-control' content='no-cache'>
161-
</head>
162-
<body>
163-
Redirect
164-
</body>
165-
</html>" > $WWW_FOLDER/redirect.html
166156

157+
sed "s|#####HOST#####|$name|g" $PIRATEBOX_FOLDER/src/redirect.html.schema > $WWW_FOLDER/redirect.html
167158
sed "s|HOST=\"$HOST\"|HOST=\"$name\"|" -i $PIRATEBOX_CONFIG
168159
}
169160

170161
if [ $2 = "hostname" ] ; then
171162
echo "Switching hostname to $3"
172163
set_hostname "$3"
173164
echo "..done"
174-
fi
165+
fi
175166

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<html>
2+
<head><title>Redirect...</title>
3+
<meta http-equiv='refresh' content='0;url=http://#####HOST#####/' />
4+
<meta http-equiv='cache-control' content='no-cache'>
5+
</head>
6+
<body>
7+
Redirect
8+
</body>
9+
</html>
10+
11+

0 commit comments

Comments
 (0)