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/local";
34 while ($ref = DXUser::get(uc $mycall)) {
35 print "old call $mycall deleted\n";
39 my $self = DXUser->new(uc $mycall);
40 $self->{alias} = uc $myalias;
41 $self->{name} = $myname;
42 $self->{qth} = $myqth;
43 $self->{qra} = uc $mylocator;
44 $self->{lat} = $mylatitude;
45 $self->{long} = $mylongitude;
46 $self->{email} = $myemail;
47 $self->{bbsaddr} = $mybbsaddr;
48 $self->{homenode} = uc $mycall;
49 $self->{sort} = 'S'; # C - Console user, S - Spider cluster, A - AK1A, U - User, B - BBS
50 $self->{priv} = 9; # 0 - 9 - with 9 being the highest
57 print "new call $mycall added\n";
59 # now do one for the alias
60 while ($ref = DXUser::get($myalias)) {
61 print "old call $myalias deleted\n";
65 $self = DXUser->new(uc $myalias);
66 $self->{name} = $myname;
67 $self->{qth} = $myqth;
68 $self->{qra} = uc $mylocator;
69 $self->{lat} = $mylatitude;
70 $self->{long} = $mylongitude;
71 $self->{email} = $myemail;
72 $self->{bbsaddr} = $mybbsaddr;
73 $self->{homenode} = uc $mycall;
74 $self->{sort} = 'U'; # C - Console user, S - Spider cluster, A - AK1A, U - User, B - BBS
75 $self->{priv} = 9; # 0 - 9 - with 9 being the highest
80 $self->{group} = [qw(local #9000)];
84 print "new call $myalias added\n";
88 die "\$myalias \& \$mycall are the same ($mycall)!, they must be different (hint: make \$mycall = '${mycall}-2';).\n" if $mycall eq $myalias;
90 $lockfn = "$main::local_data/cluster.lck"; # lock file name (now in local d
92 open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
95 die "Sorry, Lockfile ($lockfn) and process $pid exist, a cluster is running\n" if kill 0, $pid;
102 print "Update of $myalias on cluster $mycall successful\n";