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";
32 while ($ref = DXUser::get(uc $mycall)) {
33 print "old call $mycall deleted\n";
37 my $self = DXUser->new(uc $mycall);
38 $self->{alias} = uc $myalias;
39 $self->{name} = $myname;
40 $self->{qth} = $myqth;
41 $self->{qra} = uc $mylocator;
42 $self->{lat} = $mylatitude;
43 $self->{long} = $mylongitude;
44 $self->{email} = $myemail;
45 $self->{bbsaddr} = $mybbsaddr;
46 $self->{homenode} = uc $mycall;
47 $self->{sort} = 'S'; # C - Console user, S - Spider cluster, A - AK1A, U - User, B - BBS
48 $self->{priv} = 9; # 0 - 9 - with 9 being the highest
55 print "new call $mycall added\n";
57 # now do one for the alias
58 while ($ref = DXUser::get($myalias)) {
59 print "old call $myalias deleted\n";
63 $self = DXUser->new(uc $myalias);
64 $self->{name} = $myname;
65 $self->{qth} = $myqth;
66 $self->{qra} = uc $mylocator;
67 $self->{lat} = $mylatitude;
68 $self->{long} = $mylongitude;
69 $self->{email} = $myemail;
70 $self->{bbsaddr} = $mybbsaddr;
71 $self->{homenode} = uc $mycall;
72 $self->{sort} = 'U'; # C - Console user, S - Spider cluster, A - AK1A, U - User, B - BBS
73 $self->{priv} = 9; # 0 - 9 - with 9 being the highest
78 $self->{group} = [qw(local #9000)];
82 print "new call $myalias added\n";
86 $lockfn = "$root/local/cluster.lck"; # lock file name
88 open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
91 die "Sorry, Lockfile ($lockfn) and process $pid exist, a cluster is running\n" if kill 0, $pid;
95 DXUser->init($userfn, 1);
98 print "Update of $myalias on cluster $mycall successful\n";