Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
c3b1e225
Commit
c3b1e225
authored
Jul 29, 2011
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option -c to run in Utah, which need some extra work cause of the
ClearingHouse certificate.
parent
0bf47b73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
11 deletions
+26
-11
protogeni/scripts/fixcerts.in
protogeni/scripts/fixcerts.in
+26
-11
No files found.
protogeni/scripts/fixcerts.in
View file @
c3b1e225
...
@@ -13,10 +13,11 @@ use Getopt::Std;
...
@@ -13,10 +13,11 @@ use Getopt::Std;
#
#
sub
usage
()
sub
usage
()
{
{
print
STDERR
"
Usage: $0
\n
";
print
STDERR
"
Usage: $0
[-c]
\n
";
exit
(
-
1
);
exit
(
-
1
);
}
}
my
$optlist
=
"";
my
$optlist
=
"
c
";
my
$asch
=
0
;
# Configure ...
# Configure ...
my
$TB
=
"
@prefix
@
";
my
$TB
=
"
@prefix
@
";
...
@@ -52,6 +53,9 @@ my %options = ();
...
@@ -52,6 +53,9 @@ my %options = ();
if
(
!
getopts
(
$optlist
,
\
%options
))
{
if
(
!
getopts
(
$optlist
,
\
%options
))
{
usage
();
usage
();
}
}
if
(
defined
(
$options
{"
c
"}))
{
$asch
=
1
;
}
usage
()
usage
()
if
(
@ARGV
);
if
(
@ARGV
);
...
@@ -61,15 +65,17 @@ system("/bin/mkdir $stash") == 0 or
...
@@ -61,15 +65,17 @@ system("/bin/mkdir $stash") == 0 or
fatal
("
Could not mkdir
$stash
");
fatal
("
Could not mkdir
$stash
");
print
"
Copying current certificates to backup directory
\n
";
print
"
Copying current certificates to backup directory
\n
";
system
("
/bin/cp -p
$CMCERT
$SACERT
$stash
");
system
("
/bin/cp -p
$CMCERT
$SACERT
$CHCERT
$stash
");
system
("
/bin/cp -p
$SESCERT
$stash
")
if
(
-
e
$SESCERT
);
system
("
/bin/cp -p
$SESCERT
$stash
")
if
(
-
e
$SESCERT
);
#
if
(
!
$asch
)
{
# Grab the CH certificate from Utah.
#
#
# Grab the CH certificate from Utah.
print
"
Fetching clearinghouse certificate from Utah ...
\n
";
#
system
("
$FETCH
-q -o
$CHCERT
http://boss.emulab.net/genich.pem
")
==
0
print
"
Fetching clearinghouse certificate from Utah ...
\n
";
or
fatal
("
Could not fetch clearinghouse certificate from Utah
");
system
("
$FETCH
-q -o
$CHCERT
http://boss.emulab.net/genich.pem
")
==
0
or
fatal
("
Could not fetch clearinghouse certificate from Utah
");
}
#
#
# Update our local certs. Certs are updated in place, old one saved.
# Update our local certs. Certs are updated in place, old one saved.
...
@@ -86,6 +92,15 @@ print "Updating $SACERT\n";
...
@@ -86,6 +92,15 @@ print "Updating $SACERT\n";
system
("
$UPDATECERT
$SACERT
")
==
0
or
system
("
$UPDATECERT
$SACERT
")
==
0
or
fatal
("
Could not update
$SACERT
");
fatal
("
Could not update
$SACERT
");
if
(
$asch
)
{
print
"
Updating
$CHCERT
\n
";
system
("
$UPDATECERT
$CHCERT
")
==
0
or
fatal
("
Could not update
$CHCERT
");
system
("
$ADDAUTHORITY
-c
$CHCERT
ma
")
==
0
or
fatal
("
Could not add CH certificate to CH DB
");
}
#
#
# Add certs to the local SA database.
# Add certs to the local SA database.
#
#
...
@@ -107,13 +122,13 @@ system("$ADDAUTHORITY -a $CMCERT cm") == 0
...
@@ -107,13 +122,13 @@ system("$ADDAUTHORITY -a $CMCERT cm") == 0
or
fatal
("
Could not add CM certificate to CM DB
");
or
fatal
("
Could not add CM certificate to CM DB
");
#
#
# ReRegister our certs at the C
M
.
# ReRegister our certs at the C
H
.
#
#
system
("
$REREGISTER
")
==
0
system
("
$REREGISTER
")
==
0
or
fatal
("
Could not reregister certificates at the Clearinghouse
");
or
fatal
("
Could not reregister certificates at the Clearinghouse
");
#
#
# ReRegister our resources.
# ReRegister our resources
at the CH
.
#
#
print
"
Registering resources at Clearinghouse
\n
";
print
"
Registering resources at Clearinghouse
\n
";
system
("
$SUDO
-u
$PROTOUSER
$REGRESOURCES
-r
")
==
0
system
("
$SUDO
-u
$PROTOUSER
$REGRESOURCES
-r
")
==
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment