#!/usr/bin/perl -w
use strict;
$0 = join ' ', $0, @ARGV;
sub bud {
print "[$$] Forming polyp...\n";
system "./polyp.pl snapshot ./start.sh";
}
sub mate {
print "[$$] Forming tentacle...\n";
system "./tentacle.pl snapshot snapshot [CENSORED] laerad.net 40000";
}
sub alive {
my $pidfile = shift;
return unless (-e $pidfile);
open PID, '<', $pidfile;
my $pid = <PID>;
close PID;
return kill 0, $pid;
}
print "Jellyfish 2.0.0 by Pegasus Epsilon <pegasus\@pimpninjas.org>\n";
bud unless alive "snapshot.pid";
mate unless alive "snapshot.tentacle";