Modification : vm_{host,hosted,remote} -> {host,local,remote}/ .
[lhc/ateliers.git] / remote / luks-key-send
diff --git a/remote/luks-key-send b/remote/luks-key-send
new file mode 100755 (executable)
index 0000000..869e436
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh -eu
+# DESCRIPTION: envoie la clef de déchiffrement des partitions au démarrage de la VM.
+tool=$(readlink -e "${0%/*}/..")
+. "$tool"/remote/lib.sh
+
+gpg --decrypt "$tool"/var/sec/luks/$vm_fqdn.key.gpg |
+"$tool"/remote/ssh root@$vm_fqdn "$@" \
+ -o CheckHostIP=no \
+ -o HostKeyAlias=init.$vm_fqdn \
+ tee /lib/cryptsetup/passfifo \>/dev/null