base-files: fix message of initscript wrapper
[openwrt/openwrt.git] / package / base-files / files / etc / profile
index f2def7fc0bacee2f398656bad4bb142756b104bf..3eda09b456ba262e9836f3e669c01766c1e65479 100644 (file)
@@ -20,7 +20,7 @@ alias ll='ls -alF --color=auto'
 
 [ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
 
-[ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
+[ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; }
 [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
 
 [ -n "$FAILSAFE" ] || {
@@ -29,3 +29,24 @@ 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
+
+service() {
+       [ -f "/etc/init.d/$1" ] || {
+               echo "service "'"'"$1"'"'" not found, the following services are available:"
+               ls "/etc/init.d"
+               return 1
+       }
+       /etc/init.d/$@
+}