Skip to content

Commit 51aeed6

Browse files
committed
Merge branch 'visitor_count'
2 parents db98c23 + 2fc70fa commit 51aeed6

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

customization/www_librarybox/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<meta http-equiv="refresh" content="0;url=http://librarybox.lan/content" />
44
</head>
55
<body>
6-
Redirect
6+
Redirect<img src="../vc_counter.php" />
77
</body>
88
</html>

customization/www_librarybox/redirect.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<meta http-equiv="refresh" content="0;url=http://librarybox.lan/content" />
44
</head>
55
<body>
6-
Redirect
6+
<img src="../vc_counter.php" />Redirect
77
</body>
88
</html>

piratebox_origin/CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ NOTE: This may only be a partial changelog, check github / your package manager
1111
* [Fixed] General cleaning
1212
* [Removed] [Testing] Executable, we will stick to service based
1313
* [Fixed] Overwritten saved timestamp with 1970 one
14+
* [New] possibility in install_piratebox.sh to exchange the hostname easily
1415

1516
=== v0.6G ===
1617
* [Fixed] Hide dot files in directory-listing which are usually hidden files

piratebox_origin/piratebox/piratebox/bin/install_piratebox.sh

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ if [ -z $1 ] || [ -z $2 ]; then
1818
echo " imageboard : configures kareha imageboard with Basic configuration"
1919
echo " should be installed in <Piratebox-Folder>/share/board"
2020
echo " pyForum : Simple PythonForum"
21-
echo " station_cnt : Adds Statio counter to your Box - crontab entry"
22-
echo " flush_dns_reg : Installs crontask to flush dnsmasq regulary"
21+
echo " station_cnt : Adds Statio counter to your Box - crontab entry"
22+
echo " flush_dns_reg : Installs crontask to flush dnsmasq regulary"
23+
echo " hostname 'name' : Exchanges the Hostname displayed in browser"
2324
exit 1
2425
fi
2526

@@ -30,6 +31,7 @@ if [ ! -f $1 ] ; then
3031
fi
3132

3233
#Load config
34+
PIRATEBOX_CONFIG=$1
3335
. $1
3436

3537
if [ $2 = 'pyForum' ] ; then
@@ -148,3 +150,26 @@ if [ $2 = "flush_dns_reg" ] ; then
148150
[ "$?" != "0" ] && echo "an error occured" && exit 254
149151
echo "Installed crontab for flushing dnsmasq requlary"
150152
fi
153+
154+
set_Hostname() {
155+
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
166+
167+
sed "s|HOST=\"$HOST\"|HOST=\"$name\"|" -i $PIRATEBOX_CONFIG
168+
}
169+
170+
if [ $2 = "hostname" ] ; then
171+
echo "Switching hostname to $3"
172+
set_hostname "$3"
173+
echo "..done"
174+
fi
175+

0 commit comments

Comments
 (0)