Good morning all,

 

I have written a script that will promote a file from one server to another
server. I am having some troubles trying to get the script to read my values
from my form element. Basically a user will pick either a production server
or a certification server and then do a SCP based on that. I am sure I am
overlooking something simple. Here is the snippet of code:

 

# Promotion type 

my @serv_type = ('cert','prod');

 

# Create New CGI Object

my $q = new CGI;

 

my %labels = ('cert'=>'Certification',

              'prod'=>'Production');

 

if ( $q->param() ) {

 

        # Promote the file to melinadmin

        if ( $q->param('cert') ) {

        system(`. /home/apache/apache_beigep1_dsa.dat;$scp_cmd $scp_opts
$src_dir/* [EMAIL PROTECTED]:/$working_dir`);

        } elsif ( $q->param('prod') ) {

        system(`. /home/apache/apache_beigep1_dsa.dat;$scp_cmd $scp_opts
$src_dir/* [EMAIL PROTECTED]:/$working_dir`);

        }

        # system(`rm -f $src_dir/*`);

 

        # Print success 

       print  $q->header();

       print  read_file('../../htdocs/merlinadmin/htmlheadps.html');

       print  $q->p("The file has been promoted to the MERLIN Servers.");

       print   read_file('../../htdocs/merlinadmin/htmlfootps.html');

 

        # Print form on first run

         

        } else {

        print   $q->header();

        print   read_file('../../htdocs/merlinadmin/htmlheadp.html');

        print   $q->p("Please select Certification or Production Server.");

        print   $q->start_multipart_form,

                $q->popup_menu(-name=>'stype',

                               -values=>[EMAIL PROTECTED],

                               -labels=>\%labels),

                $q->br,

                $q->br,

                $q->submit('Promote'),

                $q->end_form;

        print   read_file('../../htdocs/merlinadmin/htmlfootp.html');

        }

 

As mentioned the script processes, but I am assuming that the server value
is never getting picked up, since the file does not get copied.

 

Thanks in advance,

John

Reply via email to