X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=package%2Fbase-files%2Ffiles%2Fetc%2Fprofile;h=d70bafca49ed0991d903be3f1b63f75a9282aa1b;hb=63bd73a5cfc3501c7fbeacb629da12d8278ea352;hp=8aac3b752779ecd3df5bf87f82220cc21731ebe1;hpb=291420a8f3552a1b48af4fc7418e5ca15c9ece3d;p=openwrt%2Fstaging%2Frmilecki.git diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile index 8aac3b75277..d70bafca49e 100644 --- a/package/base-files/files/etc/profile +++ b/package/base-files/files/etc/profile @@ -1,14 +1,44 @@ #!/bin/sh [ -f /etc/banner ] && cat /etc/banner +[ -e /tmp/.failsafe ] && cat /etc/banner.failsafe +fgrep -sq '/ overlay ro,' /proc/mounts && { + echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.' + echo 'Please try to remove files from /overlay/upper/... and reboot!' +} -export PATH=/bin:/sbin:/usr/bin:/usr/sbin -export HOME=/tmp +export PATH="%PATH%" +export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6) +export HOME=${HOME:-/root} export PS1='\u@\h:\w\$ ' -alias more=less -[ -x /usr/bin/vim ] || alias vim=vi +[ "$TERM" = "xterm" ] && export PS1='\[\e]0;\u@\h: \w\a\]'$PS1 + +[ -x /bin/more ] || alias more=less +[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi + +alias ll='ls -alF --color=auto' [ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc -arp() { cat /proc/net/arp; } -[ -z /bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; } +[ -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 +} + +if ( grep -qsE '^root:[!x]?:' /etc/shadow && \ + grep -qsE '^root:[!x]?:' /etc/passwd && \ + [ -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