1
0

profile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. export PATH="%PATH%"
  9. export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
  10. export HOME=${HOME:-/root}
  11. export PS1='\u@\h:\w\$ '
  12. [ "$TERM" = "xterm" ] && export PS1='\[\e]0;\u@\h: \w\a\]'$PS1
  13. [ -x /bin/more ] || alias more=less
  14. [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
  15. alias ll='ls -alF --color=auto'
  16. [ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
  17. [ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; }
  18. [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
  19. [ -n "$FAILSAFE" ] || {
  20. for FILE in /etc/profile.d/*.sh; do
  21. [ -e "$FILE" ] && . "$FILE"
  22. done
  23. unset FILE
  24. }
  25. if ( grep -qs '^root::' /etc/shadow && \
  26. [ -z "$FAILSAFE" ] )
  27. then
  28. cat << EOF
  29. === WARNING! =====================================
  30. There is no root password defined on this device!
  31. Use the "passwd" command to set up a new password
  32. in order to prevent unauthorized SSH logins.
  33. --------------------------------------------------
  34. EOF
  35. fi
  36. service() {
  37. [ -f "/etc/init.d/$1" ] || {
  38. echo "service "'"'"$1"'"'" not found, the following services are available:"
  39. ls "/etc/init.d"
  40. return 1
  41. }
  42. /etc/init.d/$@
  43. }