base-files: fix check for empty password warning
[openwrt/staging/chunkeey.git] / package / base-files / files / etc / profile
index f2def7fc0bacee2f398656bad4bb142756b104bf..f241ab2ef38658cfbb2476a087a2a6eba403351a 100644 (file)
@@ -29,3 +29,15 @@ alias ll='ls -alF --color=auto'
        done
        unset FILE
 }
+
+if ( grep -qs '^root::' /etc/shadow && \
+     [ -z "$FAILSAFE" ] )
+then
+cat << EOF
+=== WARNING! =====================================
+There is no root password defined on this device!
+Use the "passwd" command to set up a new password
+in order to prevent unauthorized SSH logins.
+--------------------------------------------------
+EOF
+fi