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/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
79 $lockfn = "$root/local/cluster.lck"; # lock file name
81 open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
84 die "Sorry, Lockfile ($lockfn) and process $pid exist, a cluster is running\n" if kill 0, $pid;
89 print "Do you wish to destroy your user database (THINK!!!) [y/N]: ";
91 if ($ans =~ /^[Yy]/) {
93 DXUser->init($userfn, 1);
96 print "Do you wish to reset your cluster and sysop information? [y/N]: ";
98 if ($ans =~ /^[Yy]/) {
99 DXUser->init($userfn, 1);
105 DXUser->init($userfn, 1);