mirror of https://schlomp.space/tastytea/hashboot
Updated openrc init script.
parent
358b75f429
commit
191753a17e
46
init/openrc
46
init/openrc
|
@ -1,37 +1,39 @@
|
||||||
#!/sbin/openrc-run
|
#!/sbin/openrc-run
|
||||||
|
# Copyright 1999-2019 Gentoo Authors
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
description="Check integrity of files in /boot"
|
description="Check integrity of files in /boot"
|
||||||
|
|
||||||
depend()
|
depend()
|
||||||
{
|
{
|
||||||
need localmount
|
need localmount
|
||||||
before xdm
|
before xdm
|
||||||
}
|
}
|
||||||
|
|
||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
ebegin "Checking integrity of files in /boot"
|
ebegin "Checking integrity of files in /boot"
|
||||||
|
|
||||||
# See if hashboot is accessible
|
# See if hashboot is accessible
|
||||||
which hashboot > /dev/null || return 255
|
which hashboot > /dev/null || return 255
|
||||||
|
|
||||||
hashboot check
|
hashboot check
|
||||||
if [ $? -gt 0 ] && [ $? -le 3 ]
|
ret=$?
|
||||||
then
|
# If return code is 1-3 or 10-13
|
||||||
echo -n "Recover files? [y/N] "
|
if [ ${ret} -ge 1 ] && [ ${ret} -le 3 ] || [ ${ret} -ge 10 ] && [ ${ret} -le 13 ]; then
|
||||||
read -r yesno
|
echo -n "Recover files? [y/N] "
|
||||||
if [ "${yesno}" == "y" ]
|
read -r yesno
|
||||||
then
|
if [ "${yesno}" == "y" ]; then
|
||||||
hashboot recover
|
hashboot recover
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Dropping to shell. Type exit to continue."
|
echo "Dropping to shell. Type exit to continue."
|
||||||
sh
|
sh
|
||||||
return 3
|
return ${ret}
|
||||||
elif [ $? != 0 ]
|
elif [ ${ret} != 0 ]; then
|
||||||
then
|
eerror "Unexpected error number ${ret}."
|
||||||
return $?
|
return ${ret}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
eend 0
|
eend 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue