Renaming script names: grub2-.* to grub-.*, including grub.cfg for update-kernel-signature

This commit is contained in:
2019-12-11 19:49:09 +01:00
parent 99a860266a
commit 271c8677d8
5 changed files with 23 additions and 16 deletions

36
sbin/grub-sign Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
# grub2-sign
# Signs everything important in /boot. Depends on grub2-verify.
# Author: Bandie
# Licence: GNU-GPLv3
function sign(){
for f in `find /boot -type f`
do
if gpg --detach-sign $f
then
echo $f signed.
else
return 1
fi
done
return 0
}
# Running grub2-verify first to prevent bad people and double signing
echo "Running grub2-verify to check if everything is unsigned..." >&2
grub2-verify
if (( $? < 2 )); then
echo "Run grub2-unsign first." >&2
exit 1
fi
if ! sign
then
sign
else
echo -e "\nDone!"
fi