Skip to content

Commit 45a5285

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 fbe7443 commit 45a5285

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
@@ -148,9 +148,9 @@ clnrest_status() {
148148
active_str="plugin-clnrest: REST server running"
149149
disabled_str="plugin-clnrest: Killing plugin: disabled itself"
150150

151-
if grep -q "$active_str" "$logfile"; then
151+
if grep -n "Opened log file" "$logfile" | cut -d : -f 1 | tail -1 | xargs -I{} tail -n +{} "$logfile" | grep -q "$active_str"; then
152152
echo "active"
153-
elif grep -q "$disabled_str" "$logfile"; then
153+
elif grep -n "Opened log file" "$logfile" | cut -d : -f 1 | tail -1 | xargs -I{} tail -n +{} "$logfile" | grep -q "$disabled_str"; then
154154
echo "disabled"
155155
else
156156
echo "waiting"

0 commit comments

Comments
 (0)