summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2014-05-28 14:37:28 +0100
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2014-05-28 16:34:21 +0100
commit85d3be7433172d1a82f7e984ecdf93676e87e664 (patch)
treeae79ef3cfde94f4b64ca227efe1eddceec61ff68
parentb6a33d69db0bea97dba40314bb1399f15e39c2cf (diff)
downloadmorph-85d3be7433172d1a82f7e984ecdf93676e87e664.tar.gz
Add ssh keys conf ext
-rwxr-xr-xmorphlib/exts/ssh-keys.configure28
1 files changed, 28 insertions, 0 deletions
diff --git a/morphlib/exts/ssh-keys.configure b/morphlib/exts/ssh-keys.configure
new file mode 100755
index 00000000..1d297d82
--- /dev/null
+++ b/morphlib/exts/ssh-keys.configure
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Copyright 2014 Codethink Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+set -e
+
+if [ "$SSHKEYS" ]
+then
+ mkdir -p "$1/root/.ssh"
+
+ for key in "$SSHKEYS"
+ do
+ cat "$key" >> "$1/root/.ssh/authorized_keys"
+ done
+fi