mirror of
https://github.com/Bandie/grub2-signing-extension.git
synced 2024-04-01 15:51:26 +00:00
Renaming script names: grub2-.* to grub-.*, including grub.cfg for update-kernel-signature
This commit is contained in:
36
sbin/grub-sign
Executable file
36
sbin/grub-sign
Executable 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
|
||||
|
Reference in New Issue
Block a user