From 6c4bea0d26550a6cce85d67551db3f87936229ae Mon Sep 17 00:00:00 2001 From: niftynei Date: Wed, 7 Aug 2024 19:23:43 -0500 Subject: [PATCH] startup-regtest: only inspect current run's logs for clnrest updates If you re-run a node several times, the log file fills with info from previous runs. To avoid looking at old logs, only parse the most recent run's logs when looking for the magic CLN rest startup/deactivated strings Changelog-Fixed: startup-regtest.sh now only inspects the most recent run's logs for the active status of the clnrest plugin --- contrib/startup_regtest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/startup_regtest.sh b/contrib/startup_regtest.sh index 1ad98f15e55f..f977d9ea943f 100755 --- a/contrib/startup_regtest.sh +++ b/contrib/startup_regtest.sh @@ -143,9 +143,9 @@ clnrest_status() { active_str="plugin-clnrest: REST server running" disabled_str="plugin-clnrest: Killing plugin: disabled itself" - if grep -q "$active_str" "$logfile"; then + if grep -n "Opened log file" "$logfile" | cut -d : -f 1 | tail -1 | xargs -I{} tail -n +{} "$logfile" | grep -q "$active_str"; then echo "active" - elif grep -q "$disabled_str" "$logfile"; then + elif grep -n "Opened log file" "$logfile" | cut -d : -f 1 | tail -1 | xargs -I{} tail -n +{} "$logfile" | grep -q "$disabled_str"; then echo "disabled" else echo "waiting"