commit:     58948705bcf5136401621a8855e9f0c15049e1dd
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Fri Nov  6 00:27:40 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Fri Nov  6 00:29:07 2020 +0000
URL:        https://gitweb.gentoo.org/proj/livecd-tools.git/commit/?id=58948705

autoconfig: Fix logic error

When the system starts, the PID file will not exist because we haven't
started dhcpcd. Also update /var/run -> /run while we're here.

Closes: https://bugs.gentoo.org/198083
Closes: https://bugs.gentoo.org/439912
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 init.d/autoconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/init.d/autoconfig b/init.d/autoconfig
index 15900c2..f475813 100644
--- a/init.d/autoconfig
+++ b/init.d/autoconfig
@@ -529,9 +529,9 @@ start() {
                if yesno "${DHCP}"
                then
                        einfo "DHCP broadcasting for IP on all detected 
interfaces ..."
-                       if [ -f /var/run/dhcpcd.pid ]
+                       if [ ! -f /run/dhcpcd.pid ]
                        then
-                               kill $(cat /var/run/dhcpcd.pid)
+                               kill $(cat /run/dhcpcd.pid)
                                sleep 2
                        fi
                        dhcpcd -n -h $(hostname)

Reply via email to