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
18 # root of directory tree for this system
20 $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
22 unshift @INC, "$root/perl"; # this IS the right way round!
23 unshift @INC, "$root/local";
35 while ($ref = DXUser::get(uc $mycall)) {
36 print "old call $mycall deleted\n";
40 my $self = DXUser->new(uc $mycall);
41 $self->{alias} = uc $myalias;
42 $self->{name} = $myname;
43 $self->{qth} = $myqth;
44 $self->{qra} = uc $mylocator;
45 $self->{lat} = $mylatitude;
46 $self->{long} = $mylongitude;
47 $self->{email} = $myemail;
48 $self->{bbsaddr} = $mybbsaddr;
49 $self->{homenode} = uc $mycall;
50 $self->{sort} = 'S'; # C - Console user, S - Spider cluster, A - AK1A, U - User, B - BBS
51 $self->{priv} = 9; # 0 - 9 - with 9 being the highest
58 print "new call $mycall added\n";
60 # now do one for the alias
61 while ($ref = DXUser::get($myalias)) {
62 print "old call $myalias deleted\n";
66 $self = DXUser->new(uc $myalias);
67 $self->{name} = $myname;
68 $self->{qth} = $myqth;
69 $self->{qra} = uc $mylocator;
70 $self->{lat} = $mylatitude;
71 $self->{long} = $mylongitude;
72 $self->{email} = $myemail;
73 $self->{bbsaddr} = $mybbsaddr;
74 $self->{homenode} = uc $mycall;
75 $self->{sort} = 'U'; # C - Console user, S - Spider cluster, A - AK1A, U - User, B - BBS
76 $self->{priv} = 9; # 0 - 9 - with 9 being the highest
81 $self->{group} = [qw(local #9000)];
85 print "new call $myalias added\n";
89 die "\$myalias \& \$mycall are the same ($mycall)!, they must be different (hint: make \$mycall = '${mycall}-2';).\n" if $mycall eq $myalias;
91 $lockfn = "$main::local_data/cluster.lck"; # lock file name (now in local d
93 open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
96 die "Sorry, Lockfile ($lockfn) and process $pid exist, a cluster is running\n" if kill 0, $pid;
103 print "Update of $myalias on cluster $mycall successful\n";