From b93a53bd94f4255f39bd204197d96b98442b9c56 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Tue, 1 Aug 2017 03:29:45 +0200 Subject: [PATCH] strongswan: check return value instead of output When the strongswan service is running, `ipsec status` returns 0. Check the return value instead of checking its output. While at it, remove the [[ ]] bashism, use rereadall instead of (reread)secrets, and move it inside the if statement. Signed-off-by: Stijn Tintel --- net/strongswan/files/ipsec.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/strongswan/files/ipsec.init b/net/strongswan/files/ipsec.init index af838a823..0bbec766c 100644 --- a/net/strongswan/files/ipsec.init +++ b/net/strongswan/files/ipsec.init @@ -331,8 +331,8 @@ restart() { reload() { prepare_env - ipsec secrets - if [[ ! -z "$(ipsec status)" ]]; then + if ipsec status > /dev/null 2>&1; then + ipsec rereadall ipsec reload else ipsec start