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 <stijn@linux-ipv6.be>
This commit is contained in:
parent
44ef6048e2
commit
b93a53bd94
1 changed files with 2 additions and 2 deletions
|
@ -331,8 +331,8 @@ restart() {
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
prepare_env
|
prepare_env
|
||||||
ipsec secrets
|
if ipsec status > /dev/null 2>&1; then
|
||||||
if [[ ! -z "$(ipsec status)" ]]; then
|
ipsec rereadall
|
||||||
ipsec reload
|
ipsec reload
|
||||||
else
|
else
|
||||||
ipsec start
|
ipsec start
|
||||||
|
|
Loading…
Reference in a new issue