From f055f018bb421cad491388debefad8c9d89df511 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 24 Jun 2013 11:37:38 +0200 Subject: [PATCH 1/3] added temporary-function for changing PirateBox-Hostname --- piratebox/piratebox/bin/install_piratebox.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index ecc5a60..e1fe204 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -30,6 +30,7 @@ if [ ! -f $1 ] ; then fi #Load config +PIRATEBOX_CONFIG=$1 . $1 if [ $2 = 'pyForum' ] ; then @@ -148,3 +149,21 @@ 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 ' + + Redirect... + + + + + Redirect + + ' > $WWW_FOLDER/redirect.html + + sed "s|HOST=\"$HOSTNAME\"|HOST=\"$name\"|" -i $PIRATEBOX_CONFIG +} + From 5e5aa16ed0f77460c029f28521993ddd1aaabd68 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 1 Jul 2013 13:28:37 +0200 Subject: [PATCH 2/3] added option to change hostname via command line --- piratebox/piratebox/bin/install_piratebox.sh | 22 +++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index e1fe204..e0bcad7 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -18,8 +18,9 @@ if [ -z $1 ] || [ -z $2 ]; then echo " imageboard : configures kareha imageboard with Basic configuration" echo " should be installed in /share/board" 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 " 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 @@ -150,20 +151,25 @@ if [ $2 = "flush_dns_reg" ] ; then echo "Installed crontab for flushing dnsmasq requlary" fi - set_Hostname() { local name=$1 ; shift; - echo ' + echo " Redirect... - - + + Redirect - ' > $WWW_FOLDER/redirect.html + " > $WWW_FOLDER/redirect.html - sed "s|HOST=\"$HOSTNAME\"|HOST=\"$name\"|" -i $PIRATEBOX_CONFIG + sed "s|HOST=\"$HOST\"|HOST=\"$name\"|" -i $PIRATEBOX_CONFIG } +if [ $2 = "hostname" ] ; then + echo "Switching hostname to $3" + set_hostname "$3" + echo "..done" +fi + From f48a6b78e6a00e3bcb4bf0a11ba06bb4348c2c38 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 1 Jul 2013 13:31:27 +0200 Subject: [PATCH 3/3] added changelog entry --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 2d7d6f6..bc3eb61 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,7 +10,7 @@ NOTE: This may only be a partial changelog, check github / your package manager * [New] can now use restart in init * [Fixed] General cleaning * [Removed] [Testing] Executable, we will stick to service based - +* [New] possibility in install_piratebox.sh to exchange the hostname easily === v0.6G === * [Fixed] Hide dot files in directory-listing which are usually hidden files