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";
29 DXUser->del_file($userfn);
34 my $ref = DXUser::get(uc $mycall);
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
56 # now do one for the alias
57 $ref = DXUser::get(uc $myalias);
60 $self = DXUser->new(uc $myalias);
61 $self->{name} = $myname;
62 $self->{qth} = $myqth;
63 $self->{qra} = uc $mylocator;
64 $self->{lat} = $mylatitude;
65 $self->{long} = $mylongitude;
66 $self->{email} = $myemail;
67 $self->{bbsaddr} = $mybbsaddr;
68 $self->{homenode} = uc $mycall;
69 $self->{sort} = 'U'; # C - Console user, S - Spider cluster, A - AK1A, U - User, B - BBS
70 $self->{priv} = 9; # 0 - 9 - with 9 being the highest
75 $self->{group} = [qw(local #9000)];
82 die "\$myalias \& \$mycall are the same ($mycall)!, they must be different (hint: make \$mycall = '${mycall}-2';).\n" if $mycall eq $myalias;
84 $lockfn = "$root/local/cluster.lck"; # lock file name
86 open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
89 die "Sorry, Lockfile ($lockfn) and process $pid exist, a cluster is running\n" if kill 0, $pid;
95 if (-e "$userfn.v2" || -e "$userfn.v3" ||-e "$userfn.v4") {
96 print "Do you wish to destroy your user database (THINK!!!) [y/N]: ";
98 if ($ans =~ /^[Yy]/) {
100 DXUser->init($userfn, 1);
103 print "Do you wish to reset your cluster and sysop information? [y/N]: ";
105 if ($ans =~ /^[Yy]/) {
106 DXUser->init($userfn, 1);
112 DXUser->init($userfn, 1);