3 # create a NEW user database and the sysop record
5 # WARNING - running this will destroy any existing user database
7 # Copyright (c) 1998 Dirk Koopman G1TLH
12 # make sure that modules are searched in the order local then perl
14 # root of directory tree for this system
16 $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
18 unshift @INC, "$root/perl"; # this IS the right way round!
19 unshift @INC, "$root/local";
27 DXUser->del_file($userfn);
32 my $ref = DXUser::get(uc $mycall);
35 my $self = DXUser->new(uc $mycall);
36 $self->{alias} = uc $myalias;
37 $self->{name} = $myname;
38 $self->{qth} = $myqth;
39 $self->{qra} = uc $mylocator;
40 $self->{lat} = $mylatitude;
41 $self->{long} = $mylongitude;
42 $self->{email} = $myemail;
43 $self->{bbsaddr} = $mybbsaddr;
44 $self->{homenode} = uc $mycall;
45 $self->{sort} = 'S'; # C - Console user, S - Spider cluster, A - AK1A, U - User, B - BBS
46 $self->{priv} = 9; # 0 - 9 - with 9 being the highest
54 # now do one for the alias
55 $ref = DXUser::get(uc $myalias);
58 $self = DXUser->new(uc $myalias);
59 $self->{name} = $myname;
60 $self->{qth} = $myqth;
61 $self->{qra} = uc $mylocator;
62 $self->{lat} = $mylatitude;
63 $self->{long} = $mylongitude;
64 $self->{email} = $myemail;
65 $self->{bbsaddr} = $mybbsaddr;
66 $self->{homenode} = uc $mycall;
67 $self->{sort} = 'U'; # C - Console user, S - Spider cluster, A - AK1A, U - User, B - BBS
68 $self->{priv} = 9; # 0 - 9 - with 9 being the highest
73 $self->{group} = [qw(local #9000)];
80 die "\$myalias \& \$mycall are the same ($mycall)!, they must be different (hint: make \$mycall = '${mycall}-2';).\n" if $mycall eq $myalias;
82 $lockfn = "$root/local/cluster.lck"; # lock file name
84 open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
87 die "Sorry, Lockfile ($lockfn) and process $pid exist, a cluster is running\n" if kill 0, $pid;
93 if (-e "$userfn.v2" || -e "$userfn.v3") {
94 print "Do you wish to destroy your user database (THINK!!!) [y/N]: ";
96 if ($ans =~ /^[Yy]/) {
98 DXUser->init($userfn, 1);
101 print "Do you wish to reset your cluster and sysop information? [y/N]: ";
103 if ($ans =~ /^[Yy]/) {
104 DXUser->init($userfn, 1);
110 DXUser->init($userfn, 1);