Hello,

I have an smp machine that I want to run two instances of setiathome
on.  I have two s@h directories (/root/.setiathome and
/root/.setiathome2).  I wrote this to run both of them at the same time
right from one script.  If I use the -a flag to run both of them, it
never moves on to start the setiathome in $setiathome2_dir.

How can I make it so both s@h clients get started?

----Begin Code----
#!/usr/bin/perl -w
use strict;
use Getopt::Std;
getopts("12a", \my %options);
sub usage {
        print "Usage: ./seti.pl [-1] [-2] [-a]
        -1      :  Start the first directory of setiathome
        -2      :  Start the second directory of setiathome
        -a      :  Start both setiathome clients\n\n";
}
my $setiathome1_dir = "/root/.setiathome/";
my $setiathome2_dir = "/root/.setiathome2/";
sub setiathome1 {
        `cd $setiathome1_dir; ./setiathome -proxy 192.168.1.3:5517`;
}

sub setiathome2 {
        `cd $setiathome2_dir; ./setiathome -proxy 192.168.1.3:5517`;
}

if (defined $options{1}) {
        setiathome1;
        exit;
}
elsif (defined $options{2}) {
        setiathome2;
        exit;
}
elsif (defined $options{a}) {
        setiathome1;
        setiathome2;
        exit;
}
else {
        usage;
        exit;
}
-----End Code----

If a better explanation is desired, e-mail me directly.

Thanks,
-- 
Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to