http://www.dxcluster.org/download/usdbraw.gz to somewhere like /tmp.
2. update from CVS.
3. Restart (on linux, just stop the node and *don't* restart on Windows).
-4. remove /spider/data/user.v1
+4. remove /spider/data/usdb.v1
5. cd /spider/perl
6. (perl) create_usdb.pl /tmp/usdbraw.gz (or wherever you put it)
6a. If you don't have Compress::Zlib loaded then you will need to gunzip
it manually and do: create_usdb.pl /tmp/usdbraw (not Windows :-)
7. on linux, in a console window do: load/usdb, on windows: restart the node.
+
+Added set/usdb command to add adding or changing of a callsign in the USDB
+
14Oct02=======================================================================
1. added show/usdb command as a simple, direct interface to the information
available in the USDB stuff.
'^cre?a?t?e?$', 'apropos create', 'apropos',
],
'd' => [
- '^dele?t?e?/u', 'delete/user', 'delete/user',
'^dele?t?e?/fu', 'kill full', 'kill',
'^dele?t?e?$', 'kill', 'kill',
'^dir?e?c?t?o?r?y?/a\w*', 'directory all', 'directory',
'^set/nota', 'unset/talk', 'unset/talk',
'^set/noww', 'unset/wwv', 'unset/wwv',
'^set/nowx', 'unset/wx', 'unset/wx',
- '^set/us', 'unset/node', 'unset/node',
+ '^set/user', 'unset/node', 'unset/node',
'^set$', 'apropos set', 'apropos',
'^sho?w?/u$', 'show/user', 'show/user',
'^sho?w?/bu', 'show/files bulletins', 'show/files',
use the script in /spider/connect/<callsign> to effect the 'chat' exchange
necessary to traverse the network(s) to logon to the cluster <callsign>.
+=== 9^DELETE/USDB <callsign> ...^Delete this user from the US State Database
+This command will completely remove a one or more callsigns
+from the US States database.
+
+There is NO SECOND CHANCE.
+
+It goes without saying that you should use this command CAREFULLY!
+
+Note that these callsign may be re-instated by any weekly updates from
+the FCC.
+
=== 9^DELETE/USER <callsign> ...^Delete this user from the User Database
This command will completely remove a one or more users from the database.
=== 0^SET/TALK^Allow TALK messages to come out on your terminal
=== 0^UNSET/TALK^Stop TALK messages coming out on your terminal
+=== 9^SET/USDB <call> <state> <city>^add/update a US DB callsign
+This command allows you to add or alter a callsign in the US state
+database. Use with extreme caution. Anything you do here will be
+overwritten by any weekly updates that affect this callsign
+
+ set/usdb g1tlh nh downtown rindge
+
+see also DELETE/USDB
+
=== 0^SET/WCY^Allow WCY messages to come out on your terminal
=== 0^UNSET/WCY^Stop WCY messages coming out on your terminal
--- /dev/null
+#
+# delete a usdb entry
+#
+# Please note that this may screw up everything to do with
+# spotting onwards
+#
+# Copyright (c) 2002 - Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, $line;
+my $call;
+my @out;
+my $user;
+
+return (1, $self->msg('e5')) if $self->priv < 9;
+
+foreach $call (@args) {
+ USDB::del($call);
+ push @out, $self->msg('susdb4', $call);
+ Log('DXCommand', $self->msg('susdb4', $call));
+}
+return (1, @out);
--- /dev/null
+#
+# Add/modify a USDB entry
+#
+# There are no checks and NO balances.
+#
+# Copyright (c) 2002 Dirk Koopman
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->priv < 9;
+
+my ($call, $state, $city) = split /\s+/, uc $line, 3;
+return (1, $self->msg('susdb1')) if length $state != 2 || !is_callsign($call);
+
+my ($ocity, $ostate) = USDB::get($call);
+my @out;
+push @out, $self->msg('susdb2', $call, $ocity, $ostate ) if $ocity;
+USDB::add($call, $city, $state);
+push @out, $self->msg('susdb3', $call, $city, $state );
+Log('DXCommand', $self->msg('susdb3', $call, $city, $state));
+return (1, @out);
+
statdx => 'Total DX Spots last 31 days',
sun => 'Location dd/mm/yyyy Rise Set',
sun_with_azel => 'Location dd/mm/yyyy Rise Set Azim Elev',
+ susdb1 => 'usage: callsign state city',
+ susdb2 => 'USDB $_[0] was $_[1], $_[2]',
+ susdb3 => 'USDB $_[0] now $_[1], $_[2]',
+ susdb4 => 'USDB $_[0] deleted',
suser1 => 'usage: callsign user_field_name value',
suser2 => 'User $_[0] not found',
suser3 => 'User field \'$_[0]\' was \'$_[1]\' now set to \'$_[2]\'',
sub init
{
end();
- if (tie %db, 'DB_File', $dbfn, O_RDONLY, 0664, $DB_BTREE) {
+ if (tie %db, 'DB_File', $dbfn, O_RDWR, 0664, $DB_BTREE) {
$present = 1;
return "US Database loaded";
}
return @s;
}
+sub _add
+{
+ my ($db, $call, $city, $state) = @_;
+
+ # lookup the city
+ my $s = uc "$city|$state";
+ my $ctyn = $db->{$s};
+ unless ($ctyn) {
+ my $no = $db->{'##'} || 1;
+ $ctyn = "#$no";
+ $db->{$s} = $ctyn;
+ $db->{$ctyn} = $s;
+ $no++;
+ $db->{'##'} = "$no";
+ }
+ $db->{uc $call} = $ctyn;
+}
+
+sub add
+{
+ _add(\%db, @_);
+}
+
sub getstate
{
return () unless $present;
return @s ? $s[0] : undef;
}
+sub del
+{
+ my $call = uc shift;
+ delete $db{$call};
+}
+
#
# load in / update an existing DB with a standard format (GZIPPED)
# "raw" file.
my $l = $_;
$l =~ s/[\r\n]+$//;
my ($call, $city, $state) = split /\|/, $l;
+
+ _add(\%dbn, $call, $city, $state);
- # lookup the city
- my $s = "$city|$state";
- my $ctyn = $dbn{$s};
- unless ($ctyn) {
- my $no = $dbn{'##'} || 1;
- $ctyn = "#$no";
- $dbn{$s} = $ctyn;
- $dbn{$ctyn} = $s;
- $no++;
- $dbn{'##'} = "$no";
- }
- $dbn{$call} = $ctyn;
$count++;
}
$of->close;