summaryrefslogtreecommitdiffstats
path: root/conf/seppl.init.in
diff options
context:
space:
mode:
Diffstat (limited to 'conf/seppl.init.in')
-rwxr-xr-xconf/seppl.init.in45
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"
}