diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index dd341a4..b9a4948 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -106,9 +106,10 @@ jobs: sed -i '/pluto/d' "$log1" pkill -HUP rsyslog systemctl restart ipsec + sleep 1 echo "Waiting for IPsec to restart." count=0 - while ! grep -q 'listening for IKE messages' "$log1"; do + while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do [ "$count" -ge "30" ] && { echo "IPsec failed to start."; exit 1; } count=$((count+1)) printf '%s' '.' @@ -400,9 +401,10 @@ jobs: sed -i '/pluto/d' "$log1" pkill -HUP rsyslog service ipsec restart + sleep 1 echo "Waiting for IPsec to restart." count=0 - while ! grep -q 'listening for IKE messages' "$log1"; do + while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do [ "$count" -ge "30" ] && { echo "IPsec failed to start."; exit 1; } count=$((count+1)) printf '%s' '.' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 588975d..2254d41 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -135,9 +135,10 @@ jobs: sed -i '/pluto/d' "$log1" pkill -HUP rsyslog systemctl restart ipsec + sleep 1 echo "Waiting for IPsec to restart." count=0 - while ! grep -q 'listening for IKE messages' "$log1"; do + while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do [ "$count" -ge "30" ] && { echo "IPsec failed to start."; exit 1; } count=$((count+1)) printf '%s' '.' @@ -429,9 +430,10 @@ jobs: sed -i '/pluto/d' "$log1" pkill -HUP rsyslog service ipsec restart + sleep 1 echo "Waiting for IPsec to restart." count=0 - while ! grep -q 'listening for IKE messages' "$log1"; do + while ! grep -q "pluto\[$(cat /var/run/pluto/pluto.pid)\]: listening for IKE messages" "$log1"; do [ "$count" -ge "30" ] && { echo "IPsec failed to start."; exit 1; } count=$((count+1)) printf '%s' '.'