base-files: fix telnet login on musl
[lede.git] / package / base-files / files / bin / login.sh
index 6682b022bad6ff314c36c5b0c0af916227c7bc2b..25627b66b299ed2b5d7aea03a38bd6462e4102f5 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 # Copyright (C) 2006-2011 OpenWrt.org
 
-if ( ! grep -qs '^root::' /etc/shadow || \
-     ! grep -qs '^root:[!x]\?:' /etc/passwd ) && \
+if ( ! grep -qsE '^root:[!x]?:' /etc/shadow || \
+     ! grep -qsE '^root:[!x]?:' /etc/passwd ) && \
    [ -z "$FAILSAFE" ]
 then
        echo "Login failed."