X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXCron.pm;h=c88ad1d3142d413dd87cb41d2c12f855eecb57dd;hb=cd86a5d3129e75ceef32b739f5a0cb5988ce7cd6;hp=42dbe2a5d6053d951db5cff878df0e8cae8e6652;hpb=95345d68a5a8ac618021c0786c7234258b903f6e;p=spider.git diff --git a/perl/DXCron.pm b/perl/DXCron.pm index 42dbe2a5..c88ad1d3 100644 --- a/perl/DXCron.pm +++ b/perl/DXCron.pm @@ -215,26 +215,16 @@ sub last_connect # disconnect a locally connected thing sub disconnect { - my $call = uc shift; - my $dxchan = DXChannel->get($call); - $dxchan->disconnect if $dxchan; + my $call = shift; + run_cmd("disconnect $call"); } # start a connect process off sub start_connect { - my $call = uc shift; - my $lccall = lc $call; - - if (Msg->conns($call)) { - dbg('cron', "Connect not started, outstanding connect to $call"); - return; - } - if (-e "$main::root/connect/$lccall") { - ExtMsg::start_connect($call, "$main::root/connect/$lccall"); - } else { - dbg('err', "Cannot find connect script for $lccall"); - } + my $call = shift; + # connecting is now done in one place - Yeah! + run_cmd("connect $call"); } # spawn any old job off @@ -281,5 +271,16 @@ sub rcmd # send it DXProt::addrcmd($DXProt::me, $call, $line); } + +sub run_cmd +{ + my $line = shift; + my @in = DXCommandmode::run_cmd($DXProt::me, $line); + dbg('cron', "cmd run: $line"); + for (@in) { + s/\s*$//og; + dbg('cron', "cmd out: $_"); + } +} 1; __END__