You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
645 B
32 lines
645 B
15 years ago
|
#!/usr/bin/env perl
|
||
|
# Copyright (C) 2004 by İsmail Dönmez
|
||
|
# Licensed under GPL v2 or later at your option
|
||
|
|
||
|
$PORT= shift;
|
||
|
$SERVER= shift;
|
||
|
$TARGET= shift;
|
||
|
|
||
|
my $i;
|
||
|
my $command;
|
||
|
|
||
|
if( $ARGV[0] eq "yes" ){
|
||
|
exec 'dcop', $PORT, 'default', 'error', 'Requested command is not executed!';
|
||
|
}
|
||
|
|
||
|
foreach $word (@ARGV) {
|
||
|
$command = $command." ".$word;
|
||
|
}
|
||
|
|
||
|
$ARG_MESSAGE = `exec $command`;
|
||
|
|
||
|
foreach $entry (split(/\n/, $ARG_MESSAGE)) {
|
||
|
chomp $entry;
|
||
|
$i=1;
|
||
|
$entry =~ s/^\//\/\//;
|
||
|
system 'dcop', $PORT, 'default', 'say', $SERVER, $TARGET, $entry;
|
||
|
}
|
||
|
|
||
|
unless($i) {
|
||
|
exec 'dcop', $PORT, 'default', 'error', "Command @ARGV doesn't exist";
|
||
|
}
|