summaryrefslogtreecommitdiffstats
path: root/luks-header-backup
diff options
context:
space:
mode:
Diffstat (limited to 'luks-header-backup')
-rwxr-xr-xluks-header-backup13
1 files changed, 13 insertions, 0 deletions
diff --git a/luks-header-backup b/luks-header-backup
new file mode 100755
index 0000000..4219df7
--- /dev/null
+++ b/luks-header-backup
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -e
+
+host=${HOST:-$HOSTNAME}
+test -n "$host"
+
+dev=$1
+dev_basename=${dev##*/}
+
+test -n "$dev_basename"
+
+cryptsetup --header-backup-file=$HOME/$host-${dev_basename}-luks-header.bak luksHeaderBackup $dev