summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2011-08-13 13:02:33 +0000
committerPaul Buetow <paul@buetow.org>2011-08-13 13:02:33 +0000
commit835c6ee12cd78cbd8caec77d11e8b074c6e5845e (patch)
tree6556f80fbb7c659da46673dd59f455d335e22d10
parent56ea44e4892cc378ae8ddaf1a1891ccdff14aaab (diff)
added host based configs
-rwxr-xr-xindex.fpl9
-rwxr-xr-xindex.pl8
2 files changed, 14 insertions, 3 deletions
diff --git a/index.fpl b/index.fpl
index 7d6e52c..a7d41b4 100755
--- a/index.fpl
+++ b/index.fpl
@@ -4,10 +4,15 @@ use strict;
use warnings;
use Xerl;
+
use FCGI;
+use Socket;
+use Sys::Hostname;
+
+my $host = hostname();
+my $config = -e "config-$host.txt" ? "config-$host.txt" : 'config.txt';
while (FCGI::accept >= 0) {
- my Xerl $xerl = Xerl->new( config => 'config.txt' );
+ my Xerl $xerl = Xerl->new( config => $config );
$xerl->run();
}
-
diff --git a/index.pl b/index.pl
index 8afda26..d5a4ef3 100755
--- a/index.pl
+++ b/index.pl
@@ -5,6 +5,12 @@ use warnings;
use Xerl;
-my Xerl $xerl = Xerl->new( config => 'config.txt' );
+use Socket;
+use Sys::Hostname;
+
+my $host = hostname();
+my $config = -e "config-$host.txt" ? "config-$host.txt" : 'config.txt';
+
+my Xerl $xerl = Xerl->new( config => $config );
$xerl->run();