profile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. [ -e /tmp/.failsafe ] && export FAILSAFE=1
  2. [ -f /etc/banner ] && cat /etc/banner
  3. [ -n "$FAILSAFE" ] && cat /etc/banner.failsafe
  4. grep -Fsq '/ 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. export ENV=/etc/shinit
  13. case "$TERM" in
  14. xterm*|rxvt*)
  15. export PS1='\[\e]0;\u@\h: \w\a\]'$PS1
  16. ;;
  17. esac
  18. [ -n "$FAILSAFE" ] || {
  19. for FILE in /etc/profile.d/*.sh; do
  20. [ -e "$FILE" ] && . "$FILE"
  21. done
  22. unset FILE
  23. }
  24. if ( grep -qs '^root::' /etc/shadow && \
  25. [ -z "$FAILSAFE" ] )
  26. then
  27. cat << EOF
  28. === WARNING! =====================================
  29. There is no root password defined on this device!
  30. Use the "passwd" command to set up a new password
  31. in order to prevent unauthorized SSH logins.
  32. --------------------------------------------------
  33. EOF
  34. fi
  35. if [ -x /usr/bin/apk ]; then
  36. cat << EOF
  37. OpenWrt recently switched to the "apk" package manager!
  38. OPKG Command APK Equivalent Description
  39. ------------------------------------------------------------------
  40. opkg install <pkg> apk add <pkg> Install a package
  41. opkg remove <pkg> apk del <pkg> Remove a package
  42. opkg upgrade apk upgrade Upgrade all packages
  43. opkg files <pkg> apk info -L <pkg> List package contents
  44. opkg list-installed apk info List installed packages
  45. opkg update apk update Update package lists
  46. opkg search <pkg> apk search <pkg> Search for packages
  47. ------------------------------------------------------------------
  48. For more https://openwrt.org/docs/guide-user/additional-software/opkg-to-apk-cheatsheet
  49. EOF
  50. fi