From 6041cb5b5a3615b934251d6cfc82642411fbcaab Mon Sep 17 00:00:00 2001 From: sthen Date: Thu, 22 Jul 2021 18:09:04 +0000 Subject: [PATCH] small tweak for default route checking, we don't care about the number of routes, only if at least one exists, so can avoid the subshell and just use grep -q. ok deraadt --- etc/rc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/etc/rc b/etc/rc index b1b36636c0e..c091fe20cae 100644 --- a/etc/rc +++ b/etc/rc @@ -1,4 +1,4 @@ -# $OpenBSD: rc,v 1.550 2021/07/22 01:53:45 deraadt Exp $ +# $OpenBSD: rc,v 1.551 2021/07/22 18:09:04 sthen Exp $ # System startup script run by init on autoboot or after single-user. # Output and error are redirected to console by init, and the console is the @@ -462,7 +462,8 @@ reorder_libs # Pause a little so at least one dynamic (slaacd or dhcpleased) config completes count=0 -while ((count++ < 20 && $(route -n show | grep -c '^default ') == 0)); do +while ((count++ < 20)); do + route -n show | grep -q ^default && break sleep .5 done -- 2.20.1