3 # remove all records with the sysop/cluster callsign and recreate
4 # it from the information contained in DXVars
6 # WARNING - this must be run when the cluster.pl is down!
8 # This WILL NOT delete an old sysop call if you are simply
9 # changing the callsign.
11 # Copyright (c) 1998 Dirk Koopman G1TLH
16 # make sure that modules are searched in the order local then perl
19 # root of directory tree for this system
21 $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
22 unshift @INC, "$root/perl"; # this IS the right way round!
23 unshift @INC, "$root/local";
29 my $lockfn = "$root/local/cluster.lck"; # lock file name
31 open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
34 die "Sorry, Lockfile ($lockfn) and process $pid exist, a cluster is running\n" if kill 0, $pid;
38 my @nodes = map { uc } @ARGV;
40 DXUser->init($userfn, 1);
45 my ($action, $key, $data) = (0,0,0);
46 for ($action = DXUser::R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = DXUser::R_NEXT) {
47 if ($data =~ m{sort => '[ACRSX]'}) {
48 my $user = DXUser::get($key);
51 if (grep $key eq $_, (@nodes, $mycall)) {
55 my $priv = $user->priv;
60 $user->priv(1) unless $priv;
68 print "locked out $count nodes out of $nodes\n";
69 print scalar @ignore, " nodes ignored (", join(',', @ignore), ")\n";
70 print "If there are any nodes missing on the above list then you MUST do\n";
71 print "a set/node (set/spider, set/clx etc) on each of them to allow them\n";
72 print "to connect to you or you to them\n";