You are on page 1of 1

#!

/bin/bash -e
# vim: set ts=8 shiftwidth=4 softtabstop=4 expandtab smarttab colorcolumn=80:
#
# Copyright (c) 2020 Red Hat, Inc.
# Author: Sergio Correia <scorreia@redhat.com>
#
# 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, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# Make sure we can unlock the device with this keyslot.
if ! clevis_luks_unlock_device_by_slot "${DEV}" "${SLT}" >/dev/null \
2>/dev/null; then
echo "Invalid configuration detected. Reverting changes." >&2
clevis_luks_restore_dev "${DEV}" "${TMP}"
exit 1
fi

echo "Binding edited successfully."

You might also like