busybox: add missing TARGET_CPPFLAGS and TARGET_LDFLAGS
[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 -o -x /sbin/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 }
32
33 if ( grep -qs '^root::' /etc/shadow && \
34 [ -z "$FAILSAFE" ] )
35 then
36 cat << EOF
37 === WARNING! =====================================
38 There is no root password defined on this device!
39 Use the "passwd" command to set up a new password
40 in order to prevent unauthorized SSH logins.
41 --------------------------------------------------
42 EOF
43 fi
44
45 service() {
46 [ -f "/etc/init.d/$1" ] || {
47 echo "service "'"'"$1"'"'" not found, the following services are available:"
48 ls "/etc/init.d"
49 return 1
50 }
51 /etc/init.d/$@
52 }