1
1
mirror of https://schlomp.space/tastytea/hashboot synced 2024-11-16 14:37:06 +01:00
hashboot/initscript.openrc

38 lines
530 B
Plaintext
Raw Normal View History

#!/sbin/openrc-run
2015-06-05 14:04:44 +02:00
description="Check integrity of files in /boot"
depend()
{
need localmount
2015-10-04 17:05:19 +02:00
before xdm
2015-06-05 14:04:44 +02:00
}
start()
{
ebegin "Checking integrity of files in /boot"
# See if hashboot is accessible
which hashboot > /dev/null || return 255
2015-06-05 14:04:44 +02:00
hashboot check
if [ $? -gt 0 ] && [ $? -le 3 ]
2015-06-05 14:04:44 +02:00
then
echo -n "Recover files? [y/N] "
read -r yesno
2015-09-26 00:19:06 +02:00
if [ "${yesno}" == "y" ]
then
hashboot recover
fi
2015-10-03 17:09:36 +02:00
echo "Dropping to shell. Type exit to continue."
2015-06-05 14:04:44 +02:00
sh
2015-10-03 17:09:36 +02:00
return 3
elif [ $? != 0 ]
then
return $?
2015-06-05 14:04:44 +02:00
fi
eend 0
}