Skip to content

Commit 647f6c9

Browse files
committed
Use FTL's build-in wait-for command for checking the logs
Signed-off-by: yubiuser <github@yubiuser.dev>
1 parent 5ff925b commit 647f6c9

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/start.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,9 @@ start() {
7575
sleep 0.5
7676
done
7777

78-
# Wait until the FTL log contains the "FTL started" message before continuing
79-
while ! grep -q '########## FTL started' /var/log/pihole/FTL.log; do
80-
sleep 0.5
81-
done
78+
# Wait until the FTL log contains the "FTL started" message before continuing, timeout after 10 seconds
79+
logsize_before=$(stat -c%s /var/log/pihole/FTL.log)
80+
pihole-FTL wait-for '########## FTL started' /var/log/pihole/FTL.log 10 "${logsize_before}" > /dev/null
8281

8382
pihole updatechecker
8483
local versionsOutput

test/tests/test_general.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_pihole_ftl_architecture(docker):
5050

5151

5252
# Wait 5 seconds for startup, then kill the start.sh script
53-
# Finally, grep the FTL log to see if it has been shut down cleanly
53+
# Finally, check the FTL log to see if it has been shut down cleanly
5454
def test_pihole_ftl_clean_shutdown(docker):
5555
func = docker.run(
5656
"""

0 commit comments

Comments
 (0)