base-files: sanitize and unify $PATH
[openwrt/staging/lynxis/omap.git] / package / base-files / files / etc / profile
index 3dd58e14f28f22e3119733e9069861587baaaee1..bd008a84d70fad6cf50fa74be5b0906e92161889 100644 (file)
@@ -2,7 +2,7 @@
 [ -f /etc/banner ] && cat /etc/banner
 [ -e /tmp/.failsafe ] && cat /etc/banner.failsafe
 
-export PATH=/usr/bin:/usr/sbin:/bin:/sbin
+export PATH=/usr/sbin:/usr/bin:/sbin:/bin
 export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
 export HOME=${HOME:-/root}
 export PS1='\u@\h:\w\$ '
@@ -14,3 +14,10 @@ export PS1='\u@\h:\w\$ '
 
 [ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
 [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
+
+[ -n "$FAILSAFE" ] || {
+       for FILE in /etc/profile.d/*.sh; do
+               [ -e "$FILE" ] && . "$FILE"
+       done
+       unset FILE
+}