From 8b35dfd4d6cbcfef7b367779df5185cc6e5afe38 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 3 Oct 2015 17:09:36 +0200 Subject: [PATCH] Initscript updates/fixes --- TODO | 1 + initscript.openrc | 5 +++-- initscript.sysv | 16 +++++++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/TODO b/TODO index 06fc483..5f75525 100644 --- a/TODO +++ b/TODO @@ -2,3 +2,4 @@ * Ubuntu package * Supress dd output while staying Debian 7 compatible * Debian and Ubuntu repositories +* Make Ubuntu 14.04 initscript work diff --git a/initscript.openrc b/initscript.openrc index 364cf70..570a8ed 100755 --- a/initscript.openrc +++ b/initscript.openrc @@ -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 $? diff --git a/initscript.sysv b/initscript.sysv index 1840a7f..eb71630 100755 --- a/initscript.sysv +++ b/initscript.sysv @@ -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