#!/usr/bin/perl -w
# -*- perl -*-

#
# $Id: redirect-bbbike.cgi,v 1.1 2003/06/16 13:55:52 eserte Exp $
# Author: Slaven Rezic
#
# Copyright (C) 2003 Slaven Rezic. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
# Mail: slaven@rezic.de
# WWW:  http://www.rezic.de/eserte/
#

use strict;
use CGI qw(:standard);
use FindBin;
use lib ("$FindBin::RealBin/..",
	 "$FindBin::RealBin/../lib",
	 "$FindBin::RealBin/../data",
	);

my $bbbike_url;
if (eval { require BBBikeVar; 1 }) {
    $BBBike::BBBIKE_DIRECT_WWW = $BBBike::BBBIKE_DIRECT_WWW; # peacify -w
    $bbbike_url = $BBBike::BBBIKE_DIRECT_WWW;
    #$bbbike_url = "http://www/~eserte/bbbike/cgi/bbbike.cgi";
} else {
    #warn "Can't get value of BBBIKE_DIRECT_WWW, use fallback:";
    print redirect("http://www.bbbike.cgi"); # without params!
    exit(0);
}

my $redirect = $bbbike_url;
if (query_string() ne "") {
    $redirect .= "?" . query_string();
}
print redirect($redirect);

__END__
