-
Notifications
You must be signed in to change notification settings - Fork 0
/
shdr_prep
executable file
·58 lines (42 loc) · 1.53 KB
/
shdr_prep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/perl
use 5.006;
use strict;
use warnings;
# Author: John A. Kunze, [email protected], California Digital Library
# Copyright (c) 2013 UC Regents
# main
{
$#ARGV < 2 and
print('
Usage: ./shdr_prep bNNNN_guess ark_shdr_guess doi_shdr_guess
From /noid/naans/forge, run "shdr_prep" to compare your guesses as to the
next prefix/NAAN and shoulders against the more official machine-generated
strings. If the same, or not too different for comfort, copy and paste
the proposed command to actually create the new shoulders.
'),
exit 1;
my ($doip_g, $dshdr_g, $ashdr_g) = @ARGV[0,1,2];
#qw(8NNNN fk4 bNNNN fk4);
my $naan_g;
($naan_g = $doip_g) =~ s/^b(\d{4})$/8$1/ or
die("mal-formed prefix: $doip_g");
my ($doip, $dshdr, $ashdr) = split /\n/,
`./mint_doip mint; ./mint_shdr mint ./mint_shdr mint`;
# `echo b9765; echo b1; echo c2`;
print "
Your guesses: $doip_g, $dshdr_g, $naan_g, $ashdr_g
Our guesses: $doip, $dshdr, $naan, $ashdr
If there's a problem, you may recycle strings by running any or all of
./mint_doip unmint X
./mint_shdr unmint Y
./mint_shdr unmint Z
where X, Y, and Z are strings from the relevant source (mint_doip, mint_shdr).
But if those are the same or close enough, run this command in production:
./make_shdr $doip/$dshdr; ./make_shdr $naan/$ashdr
To make the text records you need to store, on the laptop (for now) run
./ezidnewacct $doip $dshdr $naan $ashdr < newaccount.txt
from ~/wr/noid/newnew/src/, where newaccount.txt holds a copy of the
emailed EZID new account information form.
";
EOF
}