base-files: Enhancements to /etc/profile
[openwrt/openwrt.git] / package / base-files / files / etc / profile
1 #!/bin/sh
2 [ -f /etc/banner ] && cat /etc/banner
3 [ -e /tmp/.failsafe ] && cat /etc/banner.failsafe
4 fgrep -sq '/ overlay ro,' /proc/mounts && {
5 echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
6 echo 'Please try to remove files from /overlay/upper/... and reboot!'
7 }
8
9 export PATH="%PATH%"
10 export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
11 export HOME=${HOME:-/root}
12 export PS1='\u@\h:\w\$ '
13
14 [ "$TERM" = "xterm" ] && export PS1='\[\e]0;\u@\h: \w\a\]'$PS1
15
16 [ -x /bin/more ] || alias more=less
17 [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
18
19 alias ll='ls -alF --color=auto'
20
21 [ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
22
23 [ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
24 [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
25
26 [ -n "$FAILSAFE" ] || {
27 for FILE in /etc/profile.d/*.sh; do
28 [ -e "$FILE" ] && . "$FILE"
29 done
30 unset FILE
31 }