diff options
author | Lennart Poettering <lennart@poettering.net> | 2003-11-05 20:26:17 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2003-11-05 20:26:17 +0000 |
commit | 1962d02ba4b17212562848af5a231a5b477b7e77 (patch) | |
tree | 7242c11fe3484df11a43746701aeb54def5cd1ba | |
parent | ac63a1e476d12bf921da1c5b003022dce73daa16 (diff) |
init script fix
git-svn-id: file:///home/lennart/svn/public/seppl/trunk@10 91a2fd9b-5dcb-0310-a70a-d71e310228e6
-rwxr-xr-x | conf/seppl.init.in | 45 |
1 files 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" } |