mirror of
https://schlomp.space/tastytea/hashboot
synced 2024-11-16 14:37:06 +01:00
38 lines
530 B
Plaintext
Executable File
38 lines
530 B
Plaintext
Executable File
#!/sbin/openrc-run
|
|
|
|
description="Check integrity of files in /boot"
|
|
|
|
depend()
|
|
{
|
|
need localmount
|
|
before xdm
|
|
}
|
|
|
|
start()
|
|
{
|
|
ebegin "Checking integrity of files in /boot"
|
|
|
|
# See if hashboot is accessible
|
|
which hashboot > /dev/null || return 255
|
|
|
|
hashboot check
|
|
if [ $? -gt 0 ] && [ $? -le 3 ]
|
|
then
|
|
echo -n "Recover files? [y/N] "
|
|
read -r yesno
|
|
if [ "${yesno}" == "y" ]
|
|
then
|
|
hashboot recover
|
|
fi
|
|
|
|
echo "Dropping to shell. Type exit to continue."
|
|
sh
|
|
return 3
|
|
elif [ $? != 0 ]
|
|
then
|
|
return $?
|
|
fi
|
|
|
|
eend 0
|
|
}
|