#! /usr/bin/perl

my $testgood = `modules/check_dir.pl | tail -1`;
if ( $testgood != 1 ) {
    printf("Strange directory.\n");
    printf("Please run this script only in Stand1 or Stand2 directory.\n");
    exit;
}

$p_w_d = `pwd`;
if ( $p_w_d =~ /.*Stand1$/ ) {
  $TRD_FEE="TRD-FEE_2_0_0";
  printf("======================================================\n"); 
  printf("We are using teststand 1! TRD_FEE is $TRD_FEE \n");
  printf("======================================================\n"); 
} elsif ( $p_w_d =~ /.*Stand2$/ ) {
  $TRD_FEE="TRD-FEE_2_0_1";
  printf("======================================================\n"); 
  printf("We are using teststand 1! TRD_FEE is $TRD_FEE \n");
  printf("======================================================\n"); 
}

open( FH, ">_trd_fee" ) || die "Could not open _trd_fee file";
printf( FH "# you can source me in shell script.\n");
printf( FH "TRD_FEE=$TRD_FEE\n");
close(FH);

#EOF
