Skip to content

Commit d9eb409

Browse files
niftyneidaywalker90
authored andcommitted
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
1 parent 500e40e commit d9eb409

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/startup_regtest.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ clnrest_status() {
143143
active_str="plugin-clnrest: REST server running"
144144
disabled_str="plugin-clnrest: Killing plugin: disabled itself"
145145

146-
if grep -q "$active_str" "$logfile"; then
146+
if grep -n "Opened log file" "$logfile" | cut -d : -f 1 | tail -1 | xargs -I{} tail -n +{} "$logfile" | grep -q "$active_str"; then
147147
echo "active"
148-
elif grep -q "$disabled_str" "$logfile"; then
148+
elif grep -n "Opened log file" "$logfile" | cut -d : -f 1 | tail -1 | xargs -I{} tail -n +{} "$logfile" | grep -q "$disabled_str"; then
149149
echo "disabled"
150150
else
151151
echo "waiting"

0 commit comments

Comments
 (0)