Skip to content

Commit

Permalink
Automatticlly add keyscript to crypttab cornelinux#52
Browse files Browse the repository at this point in the history
  • Loading branch information
thuandt committed Jun 21, 2019
1 parent 1a39cd2 commit a645f23
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions yubikey-luks-enroll
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,17 @@ else
if [ "$DBG" = "1" ]; then echo "LUKS key: $R"; fi
fi

# add keyscript to /etc/crypttab
if [ -b "${DISK}" ]
then
echo "${DISK} searching from disk/by-uuid"
UUID="$( blkid -s UUID -o value "$DISK" )"
fi

if ! grep 'keyscript=/usr/share/yubikey-luks/ykluks-keyscript' /etc/crypttab
then
sed -i "/${UUID}/ s/$/,keyscript=\/usr\/share\/yubikey-luks\/ykluks-keyscript/" /etc/crypttab
update-initramfs -u
fi

exit 0

0 comments on commit a645f23

Please sign in to comment.