summaryrefslogtreecommitdiffstats
path: root/luks-header-backup
blob: 38c0e7fa7bb8c5c2a82cc63979eb6ac75dd45943 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

set -e

host=${HOST:-$HOSTNAME}
test -n "$host"

dev=$1
dev_basename=${dev##*/}
outfile="$HOME/$host-${dev_basename}-luks-header.bak"

test -n "$dev_basename"

cryptsetup --header-backup-file="$outfile" luksHeaderBackup $dev
gpg --batch -r 0x6D1655C14CE1C13E -e "$outfile"
rm "$outfile"
chown flo:users "$outfile.gpg"