Merge branch 'change_hostname' into release-1.0

Conflicts:
	CHANGELOG
This commit is contained in:
Matthias Strubel 2013-08-11 17:10:59 +02:00
commit 1f4b863bc3
2 changed files with 28 additions and 2 deletions

View file

@ -8,6 +8,7 @@ NOTE: This may only be a partial changelog, check github / your package manager
* [New] install method
* [New] install dependencies
* [Fixed] General cleaning
* [New] possibility in install_piratebox.sh to exchange the hostname easily
* [Fixed] Hide dot files in directory-listing which are usually hidden files
* [New] Moved DHCP leasefile into memory on OpenWRT system (/tmp is memory)

View file

@ -20,6 +20,7 @@ if [ -z $1 ] || [ -z $2 ]; then
echo " pyForum : Simple PythonForum"
echo " station_cnt : Adds Statio counter to your Box - crontab entry"
echo " flush_dns_reg : Installs crontask to flush dnsmasq regulary"
echo " hostname 'name' : Exchanges the Hostname displayed in browser"
exit 1
fi
@ -30,6 +31,7 @@ if [ ! -f $1 ] ; then
fi
#Load config
PIRATEBOX_CONFIG=$1
. $1
if [ $2 = 'pyForum' ] ; then
@ -148,3 +150,26 @@ if [ $2 = "flush_dns_reg" ] ; then
[ "$?" != "0" ] && echo "an error occured" && exit 254
echo "Installed crontab for flushing dnsmasq requlary"
fi
set_Hostname() {
local name=$1 ; shift;
echo "
<html>
<head><title>Redirect...</title>
<meta http-equiv='refresh' content='0;url=http://$1/' />
<meta http-equiv='cache-control' content='no-cache'>
</head>
<body>
Redirect
</body>
</html>" > $WWW_FOLDER/redirect.html
sed "s|HOST=\"$HOST\"|HOST=\"$name\"|" -i $PIRATEBOX_CONFIG
}
if [ $2 = "hostname" ] ; then
echo "Switching hostname to $3"
set_hostname "$3"
echo "..done"
fi