mirror of https://schlomp.space/tastytea/hashboot
Initscript updates/fixes
parent
59737fb019
commit
8b35dfd4d6
1
TODO
1
TODO
|
@ -2,3 +2,4 @@
|
||||||
* Ubuntu package
|
* Ubuntu package
|
||||||
* Supress dd output while staying Debian 7 compatible
|
* Supress dd output while staying Debian 7 compatible
|
||||||
* Debian and Ubuntu repositories
|
* Debian and Ubuntu repositories
|
||||||
|
* Make Ubuntu 14.04 initscript work
|
||||||
|
|
|
@ -12,7 +12,7 @@ start()
|
||||||
ebegin "Checking integrity of files in /boot"
|
ebegin "Checking integrity of files in /boot"
|
||||||
|
|
||||||
# See if hashboot.sh is accessible
|
# See if hashboot.sh is accessible
|
||||||
which hashboot.sh > /dev/null || return 1
|
which hashboot.sh > /dev/null || return 255
|
||||||
|
|
||||||
hashboot.sh check
|
hashboot.sh check
|
||||||
if [ $? -gt 0 ] && [ $? -le 3 ]
|
if [ $? -gt 0 ] && [ $? -le 3 ]
|
||||||
|
@ -24,8 +24,9 @@ start()
|
||||||
hashboot.sh recover
|
hashboot.sh recover
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Dropping to shell. Type exit to continue."
|
||||||
sh
|
sh
|
||||||
return 4
|
return 3
|
||||||
elif [ $? != 0 ]
|
elif [ $? != 0 ]
|
||||||
then
|
then
|
||||||
return $?
|
return $?
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: hashboot
|
# Provides: hashboot
|
||||||
|
@ -9,10 +9,10 @@
|
||||||
# Short-Description: Check integrity of files in /boot
|
# Short-Description: Check integrity of files in /boot
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
PATH=/sbin:/bin:/usr/bin
|
#PATH=/sbin:/bin:/usr/bin:/usr
|
||||||
|
|
||||||
# See if hashboot.sh is accessible
|
# See if hashboot.sh is accessible
|
||||||
test -x $(which hashboot.sh) || exit 0
|
test -x $(which hashboot.sh) || exit 255
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
|
@ -25,14 +25,16 @@ case "$1" in
|
||||||
|
|
||||||
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.sh recover
|
hashboot.sh recover
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Dropping to shell. Type exit to continue."
|
||||||
sh
|
sh
|
||||||
exit 4
|
exit 3
|
||||||
elif [ $? != 0 ]
|
elif [ $? != 0 ]
|
||||||
|
then
|
||||||
log_end_msg $?
|
log_end_msg $?
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
@ -45,11 +47,11 @@ case "$1" in
|
||||||
;;
|
;;
|
||||||
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 2
|
exit 1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: /etc/init.d/hashboot {start|stop}"
|
echo "Usage: /etc/init.d/hashboot {start|stop}"
|
||||||
exit 2
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue