Commit a6e608d1 authored by Mike Hibler's avatar Mike Hibler

Don't try to backup authorized_keys (and thus fail) if the file doesn't exist.

parent c938a298
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# Copyright (c) 2004, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -124,8 +124,10 @@ sub doboot()
my $authkeys = "/root/.ssh/authorized_keys";
my $authkeys2 = "/root/.ssh/authorized_keys2";
system("cp -pf $authkeys $authkeys2") == 0
or fatal("Could not backup root ssh authorized_keys file");
if (-e "$authkeys") {
system("cp -pf $authkeys $authkeys2") == 0
or fatal("Could not backup root ssh authorized_keys file");
}
if (!open(AUTHKEYS, "> ${authkeys}.new")) {
warning("Could not open ${authkeys}.new: $!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment