From 1962d02ba4b17212562848af5a231a5b477b7e77 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 5 Nov 2003 20:26:17 +0000 Subject: init script fix git-svn-id: file:///home/lennart/svn/public/seppl/trunk@10 91a2fd9b-5dcb-0310-a70a-d71e310228e6 --- conf/seppl.init.in | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/conf/seppl.init.in b/conf/seppl.init.in index 79ee4d5..32f517b 100755 --- a/conf/seppl.init.in +++ b/conf/seppl.init.in @@ -1,6 +1,6 @@ -#! /bin/sh +#!/bin/bash -# $Id: Makefile.am 40 2003-10-27 18:32:45Z lennart $ +# $Id$ # # This file is part of seppl. # @@ -45,10 +45,22 @@ load_keys() { clear_keys() { echo -n "Clearing SEPPL keys: " ( echo "clear" > "$PROCFILE" ) 2> /dev/null - if test -s "$PROCFILE" ; then + + local FAIL=1 + + for (( i=0; $i < 5; i++)); do + if ! test -s "$PROCFILE" ; then + FAIL=0 + break + fi + sleep 1 + done + + if [ "$FAIL" -ne 0 ]; then echo "failure" exit 1 fi + echo "success" } @@ -56,10 +68,21 @@ clear_keys() { load_modules() { echo -n "Loading SEPPL module: " modprobe seppl &> /dev/null - if ! test -f "$PROCFILE" ; then + local FAIL=1 + for (( i=0; $i < 5; i++)); do + if test -f "$PROCFILE" ; then + FAIL=0 + break + fi + + sleep 1 + done + + if [ "$FAIL" -ne 0 ] ; then echo "failure" exit 1 fi + echo "success" } @@ -68,10 +91,22 @@ unload_modules() { modprobe -r ipt_CRYPT &> /dev/null modprobe -r ipt_DECRYPT &> /dev/null modprobe -r seppl &> /dev/null - if test -f "$PROCFILE" ; then + + local FAIL=1 + + for (( i=0; $i < 5; i++)); do + if ! test -f "$PROCFILE" ; then + FAIL=0 + break + fi + sleep 1 + done + + if [ "$FAIL" -ne 0 ] ; then echo "failure" exit 1 fi + echo "success" } -- cgit