mirror of
https://schlomp.space/tastytea/hashboot
synced 2024-11-16 14:37:06 +01:00
Updated SysVinit script.
This commit is contained in:
parent
191753a17e
commit
02121e496c
66
init/sysv
66
init/sysv
@ -15,44 +15,42 @@
|
|||||||
test -x $(which hashboot) || exit 255
|
test -x $(which hashboot) || exit 255
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
log_daemon_msg "Checking integrity of files in /boot"
|
log_daemon_msg "Checking integrity of files in /boot"
|
||||||
|
|
||||||
hashboot check
|
hashboot check
|
||||||
if [ $? -gt 0 ] && [ $? -le 3 ]
|
ret=$?
|
||||||
then
|
if [ ${ret} -ge 1 ] && [ ${ret} -le 3 ] || [ ${ret} -ge 10 ] && [ ${ret} -le 13 ]; then
|
||||||
log_end_msg 4
|
log_end_msg ${ret}
|
||||||
|
|
||||||
echo -n "Recover files? [y/N] "
|
echo -n "Recover files? [y/N] "
|
||||||
read -r yesno
|
read -r yesno
|
||||||
if [ "${yesno}" == "y" ]
|
if [ "${yesno}" == "y" ]; then
|
||||||
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
|
||||||
exit 3
|
exit ${ret}
|
||||||
elif [ $? != 0 ]
|
elif [ ${ret} != 0 ]; then
|
||||||
then
|
log_end_msg ${ret}
|
||||||
log_end_msg $?
|
eerror "Unexpected error number ${ret}."
|
||||||
exit $?
|
exit ${ret}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log_end_msg 0
|
log_end_msg 0
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
# No-op
|
# No-op
|
||||||
|
;;
|
||||||
;;
|
restart|reload|force-reload|status)
|
||||||
restart|reload|force-reload|status)
|
echo "Error: argument '$1' not supported" >&2
|
||||||
echo "Error: argument '$1' not supported" >&2
|
exit 1
|
||||||
exit 1
|
;;
|
||||||
;;
|
*)
|
||||||
*)
|
echo "Usage: /etc/init.d/hashboot {start|stop}"
|
||||||
echo "Usage: /etc/init.d/hashboot {start|stop}"
|
exit 1
|
||||||
exit 1
|
;;
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user