Don't rely on /etc/init.d being OpenRC
[openresolv] / libc
diff --git a/libc b/libc
index 311d737df3052d2c11a4c26f2bcd874cfcdbe2a1..13a0521455354b684fe9fdb67eda5108ab0be5ba 100755 (executable)
--- a/libc
+++ b/libc
@@ -143,9 +143,12 @@ printf "${NEWCONF}" > "${RESOLVCONF}"/run/resolv.conf
 
 # Restart nscd if it's running
 if [ -x /etc/init.d/nscd ]; then
-       /etc/init.d/nscd --nodeps --quiet conditionalrestart
-fi
-if [ -x /etc/rc.d/nscd ]; then
+       if [ -x /sbin/runscript ]; then
+               /etc/init.d/nscd --nodeps --quiet conditionalrestart
+       else
+               /etc/init.d/nscd restart
+       fi
+elif [ -x /etc/rc.d/nscd ]; then
        /etc/rc.d/nscd restart
 fi