X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=perl%2Fcreate_sysop.pl;h=0ec29039acd90065efc1331b1e978b52df17d5f1;hb=fb8e4bcdc434a78a5fee2837e02401df88623555;hp=c0ac9e3afc7d8557803a71fc146e65a72fc09349;hpb=ab811a0c902225075a9bd69749f65594079433a9;p=spider.git diff --git a/perl/create_sysop.pl b/perl/create_sysop.pl index c0ac9e3a..0ec29039 100755 --- a/perl/create_sysop.pl +++ b/perl/create_sysop.pl @@ -15,9 +15,12 @@ BEGIN { $root = "/spider"; $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'}; + unshift @INC, "$root/perl"; # this IS the right way round! unshift @INC, "$root/local"; } +package main; + use DXVars; use DXUser; @@ -76,6 +79,8 @@ sub create_it } +die "\$myalias \& \$mycall are the same ($mycall)!, they must be different (hint: make \$mycall = '${mycall}-2';).\n" if $mycall eq $myalias; + $lockfn = "$root/local/cluster.lck"; # lock file name if (-e $lockfn) { open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!"; @@ -85,9 +90,9 @@ if (-e $lockfn) { close CLLOCK; } -$DXUser::v3 = 1; +$DXUser::v4 = 1; -if (-e "$userfn.v2" || -e "$userfn.v3") { +if (-e "$userfn.v2" || -e "$userfn.v3" ||-e "$userfn.v4") { print "Do you wish to destroy your user database (THINK!!!) [y/N]: "; $ans = ; if ($ans =~ /^[Yy]/) { @@ -107,6 +112,7 @@ if (-e "$userfn.v2" || -e "$userfn.v3") { DXUser->init($userfn, 1); create_it(); } +DXUser->sync; DXUser->finish(); exit(0);