From 8a3ed67874efa3f8c3fa56c53d2268898a30a9f3 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Thu, 25 Apr 2013 16:57:58 +0200 Subject: [PATCH] storage_deploy.sh: remove key from storage after deploy Signed-off-by: Thilo Fromm --- storage_deploy.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/storage_deploy.sh b/storage_deploy.sh index 0c1d168..d4c7309 100755 --- a/storage_deploy.sh +++ b/storage_deploy.sh @@ -18,6 +18,19 @@ prepare() { } # ---- +cleanup() { + local srv="$1" + + # remove installer key from list of root authorized keys + rexec "$srv" "sed 's/.*\ storageautoinstaller@host/# ...key removed by auto-deploy script./' /root/.ssh/authorized_keys" \ + || { log " ERROR removing installer ssh key from storage server $srv." + log " ####### MANUAL ATTENTION REQUIRED #######" + return 1} + + return 0 + +} +# ---- rexec() { local srv="$1" ; shift @@ -166,6 +179,8 @@ main() { rexec "$storage_ip" "reboot" || return 1 wait_for_reboot 600 $storage_ip || { log " ABORT"; return 1; } + cleanup || return 1 + log " S U C C E S S" log " Your storage server is now available at $storage_ip." } -- 2.39.5