1. added HC and QRZ.com to possible QSL locations, if you want to pick up
historical info (ie start again), run create_qsl.pl after update and restart
the node (which you will need to do anyway).
+2. changed the dbcreate command so that you can say:
+ dbcreate dxqsl cmd show/dxqsl
+which will allow local and remote users to execute commands as though they
+are Databases. You can also include these databases in chains. What you do
+with this, is ofcourse a moot question.
11Mar03=======================================================================
1. Changed the name of show/qsl to show/dxqsl.
2. Alter Commands_en.hlp to match new name and issue manual updates (g0vgs)
=== 9^DBCREATE <name>^Create a database entry
=== 9^DBCREATE <name> chain <name> [<name>..]^Create a chained database entry
=== 9^DBCREATE <name> remote <node>^Create a remote database entry
+=== 9^DBCREATE <name> cmd <dxspider command>^make a local command available as a DB
DBCREATE allows you to define a database in the system. It doesn't actually
create anything, just defines it.
to work as they may be used to.
+You can also make local commands available as 'pseudo' databases. You
+can therefore make spider special commands available as a database. I
+imagine that this will be primarily useful for remote access from
+legacy nodes. For example:-
+
+ DBCREATE dxqsl cmd show/dxqsl
+
+You also use one of these databases in a chain. This may be useful
+locally.
+
See DBIMPORT for the importing of existing AK1A format data to databases.
See DBSHOW for generic database enquiry
my $f;
foreach $f (values %DXDb::avail) {
- push @out, "DB Name Location Chain" unless @out;
- push @out, sprintf "%-15s %-10s %s", $f->name, $f->remote ? $f->remote : "Local", $f->chain ? parray($f->chain) : "";
+ push @out, "DB Name Location Cmd Chain" unless @out;
+ push @out, sprintf "%-15s %-10s %-15s %s", $f->name, $f->remote ? $f->remote : "Local", ($f->localcmd || ""), $f->chain ? parray($f->chain) : "";
}
return (1, @out);
my $remote;
my $chain;
+my $cmd;
while (@f) {
my $f = lc shift @f;
if ($f eq 'remote') {
$remote = uc shift @f if @f;
next;
}
+ if ($f eq 'cmd') {
+ $cmd = lc shift @f if @f;
+ next;
+ }
if ($f eq 'chain') {
if (@f) {
$chain = [ @f ];
}
}
}
-DXDb::new($name, $remote, $chain);
+DXDb::new($name, $remote, $chain, $cmd);
push @out, $self->msg($remote ? 'db7' : 'db8', $name, $remote);
return (1, @out);
tae => '9,End App txt',
atemplate => '9,App Templates,parray',
help => '0,Help txt,parray',
+ localcmd => '0,Local Command',
);
$lastprocesstime = time;
# make sure we are open
$self->open;
- if ($self->{db}) {
+ if ($self->{localcmd}) {
+ my $dxchan = $main::me;
+ $dxchan->{remotecmd} = 1; # for the benefit of any command that needs to know
+ my $oldpriv = $dxchan->{priv};
+ $dxchan->{priv} = 0;
+ my @in = (DXCommandmode::run_cmd($dxchan, "$self->{localcmd} $key"));
+ $dxchan->{priv} = $oldpriv;
+ delete $dxchan->{remotecmd};
+ return @in ? join("\n", @in) : undef;
+ } elsif ($self->{db}) {
my $s = $self->{db}->get($key, $value);
return $s ? undef : $value;
}
my $name = shift;
my $remote = shift;
my $chain = shift;
+ my $cmd = shift;
+
$self->{name} = lc $name;
$self->{remote} = uc $remote if $remote;
$self->{chain} = $chain if $chain && ref $chain;
$self->{accesst} = $self->{createt} = $self->{lastt} = $main::systime;
+ $self->{localcmd} = lc $cmd if $cmd;
+
$avail{$self->{name}} = $self;
mkdir $dbbase, 02775 unless -e $dbbase;
save();