Skip to content

Commit

Permalink
startup-regtest: only inspect current run's logs for clnrest updates
Browse files Browse the repository at this point in the history
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
  • Loading branch information
niftynei authored and ShahanaFarooqui committed Jan 30, 2025
1 parent 43905df commit cac7022
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/startup_regtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,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"
Expand Down

0 comments on commit cac7022

Please sign in to comment.