initial vars and absolute R_ things in sh/node sh/lockout and sh/isolate
[spider.git] / perl / import_users.pl
1 #!/usr/bin/perl
2 #
3 # Export the user file in a form that can be directly imported
4 # back with a do statement
5 #
6
7 require 5.004;
8
9 # search local then perl directories
10 BEGIN {
11         umask 002;
12         
13         # root of directory tree for this system
14         $root = "/spider"; 
15         $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
16         
17         unshift @INC, "$root/perl";     # this IS the right way round!
18         unshift @INC, "$root/local";
19 }
20
21 use DXVars;
22 use DXUser;
23 use DXUtil;
24 use Carp;
25
26 $inpfn = $ARGV[0] if @ARGV;
27 croak "need a input filename" unless $inpfn;
28
29 DXUser->del_file($userfn);
30 DXUser->init($userfn, 1);
31
32 my $s = readfilestr "$inpfn";
33 eval $s;
34 print $@ if $@;
35
36 DXUser->finish();