diff options
author | Tobias Brunner <tobias@strongswan.org> | 2015-12-10 11:46:21 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2015-12-10 11:46:21 +0100 |
commit | 7f52715655aaed748ad8cf37ad0af8367b7f80b3 (patch) | |
tree | 39705ae7e21f8f95a699ea617cef0fae373a9707 | |
parent | bb723f97c746c1412c9fd81536bf6520fd6ec79f (diff) | |
download | strongswan-7f52715655aaed748ad8cf37ad0af8367b7f80b3.tar.bz2 strongswan-7f52715655aaed748ad8cf37ad0af8367b7f80b3.tar.xz |
ipsec: Fix stop command on systems where sleep(1) only supports integers
Fixes #1231.
-rw-r--r-- | src/ipsec/_ipsec.in | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ipsec/_ipsec.in b/src/ipsec/_ipsec.in index 89c7ef753..a002614fe 100644 --- a/src/ipsec/_ipsec.in +++ b/src/ipsec/_ipsec.in @@ -259,10 +259,15 @@ stop) loop=110 while [ $loop -gt 0 ] ; do kill -0 $spid 2>/dev/null || break - sleep 0.1 + sleep 0.1 2>/dev/null + if [ $? -ne 0 ] + then + sleep 1 + loop=$(($loop - 9)) + fi loop=$(($loop - 1)) done - if [ $loop -eq 0 ] + if [ $loop -le 0 ] then kill -KILL $spid 2>/dev/null rm -f $IPSEC_STARTER_PID |