3 # pretend that you are another user, execute a command
4 # as that user, then send the output back to them.
6 # This is for educating users....
8 # Copyright (c) 2002 Dirk Koopman G1TLH
10 my ($self, $line) = @_;
12 my ($call, $newline) = split /\s+/, $line, 2;
14 my $dxchan = DXChannel->get($call);
16 return (1, $self->msg('e7', $call)) unless $dxchan;
17 if ($self->remotecmd) {
18 Log('DXCommand', "$mycall is trying to 'demo' to $call remotely");
19 return (1, $self->msg('e5'));
21 if ($self->priv < 9) {
22 Log('DXCommand', "$mycall is trying to 'demo' to $call locally");
23 return (1, $self->msg('e5'));
25 Log('DXCommand', "demo '$newline' to $call by $mycall");
26 my @in = $dxchan->run_cmd($newline);
28 $dxchan->send($newline, @in);
30 return (1, map { "->$call: $_" } @in);