Initscript updates/fixes

pull/1/head
tastytea 2015-10-03 17:09:36 +02:00
parent 59737fb019
commit 8b35dfd4d6
3 changed files with 13 additions and 9 deletions

1
TODO
View File

@ -2,3 +2,4 @@
* Ubuntu package
* Supress dd output while staying Debian 7 compatible
* Debian and Ubuntu repositories
* Make Ubuntu 14.04 initscript work

View File

@ -12,7 +12,7 @@ start()
ebegin "Checking integrity of files in /boot"
# See if hashboot.sh is accessible
which hashboot.sh > /dev/null || return 1
which hashboot.sh > /dev/null || return 255
hashboot.sh check
if [ $? -gt 0 ] && [ $? -le 3 ]
@ -24,8 +24,9 @@ start()
hashboot.sh recover
fi
echo "Dropping to shell. Type exit to continue."
sh
return 4
return 3
elif [ $? != 0 ]
then
return $?

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
### BEGIN INIT INFO
# Provides: hashboot
@ -9,10 +9,10 @@
# Short-Description: Check integrity of files in /boot
### END INIT INFO
PATH=/sbin:/bin:/usr/bin
#PATH=/sbin:/bin:/usr/bin:/usr
# See if hashboot.sh is accessible
test -x $(which hashboot.sh) || exit 0
test -x $(which hashboot.sh) || exit 255
case "$1" in
start)
@ -25,14 +25,16 @@ case "$1" in
echo -n "Recover files? [y/N] "
read -r yesno
if [ ${yesno} == "y" ]
if [ "${yesno}" == "y" ]
then
hashboot.sh recover
fi
echo "Dropping to shell. Type exit to continue."
sh
exit 4
exit 3
elif [ $? != 0 ]
then
log_end_msg $?
exit $?
fi
@ -45,11 +47,11 @@ case "$1" in
;;
restart|reload|force-reload|status)
echo "Error: argument '$1' not supported" >&2
exit 2
exit 1
;;
*)
echo "Usage: /etc/init.d/hashboot {start|stop}"
exit 2
exit 1
;;
esac