#!/usr/bin/perl

# Access the MOPS config to determine the MPC Export flag.
# Return 1 if the flag is set to 1, 0 if it is not.

use strict;
use PS::MOPS::DC::Instance;

my $instance_name=$ARGV[0];
if(!$instance_name){
    die "ERROR: No instance name was provided.\n";
}

my $inst = PS::MOPS::DC::Instance->new(DBNAME => $instance_name);

# How is a valid instance determined?
if(!$inst) { # Not correct
    die "ERROR: Instance name is invalid!";
}

my $mops_config = $inst->getConfig();

if($mops_config->{mpc_export}->{export_data_to_the_mpc_datastore}==1){
    print "1";
}
else {
    print "0";
}
