fix $HOME in /etc/profile (#4424)
authorFelix Fietkau <nbd@openwrt.org>
Wed, 7 Jan 2009 04:38:57 +0000 (04:38 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 7 Jan 2009 04:38:57 +0000 (04:38 +0000)
SVN-Revision: 13914

package/base-files/files/etc/profile

index e82408ff83516ec989622e50051a5af945d9fec3..1f680655f71167fbff8acb5796671c737a212992 100644 (file)
@@ -2,7 +2,8 @@
 [ -f /etc/banner ] && cat /etc/banner
 
 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export HOME=/root
+export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
+export HOME=${HOME:-/root}
 export PS1='\u@\h:\w\$ '
 
 [ -x /bin/more ] || alias more=less