diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2022-09-09 13:08:43 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2022-10-01 21:30:56 +0000 |
| commit | 497cdf9673ec53d59634bb78862cd8dea3d5c155 (patch) | |
| tree | c2d6c4d73387255f71d05abee6562651c0986c0f | |
| parent | 03994c24da957ffd6556096cdd6f6522eb968ba8 (diff) | |
| download | src-497cdf9673ec53d59634bb78862cd8dea3d5c155.tar.gz src-497cdf9673ec53d59634bb78862cd8dea3d5c155.zip | |
sh: read more profile files.
Differential Revision: https://reviews.freebsd.org/D36505
MFC after: 1 month
| -rw-r--r-- | bin/sh/profile | 20 | ||||
| -rw-r--r-- | etc/mtree/BSD.root.dist | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/bin/sh/profile b/bin/sh/profile index b77c8787c79d..afcbeaf4110b 100644 --- a/bin/sh/profile +++ b/bin/sh/profile @@ -12,3 +12,23 @@ # msgs -q # Allow terminal messages # mesg y + +# Load each file in /etc/profile.d/, then /usr/local/etc/profile, then +# each file in /usr/local/etc/profile.d/. +_loaded=${_loaded:-/etc/profile} +export _loaded +for _dir in /etc /usr/local/etc ; do + for _file in "${_dir}"/profile "${_dir}"/profile.d/* ; do + if [ -f "${_file}" ] ; then + case :${_loaded}: in + *:"${_file}":*) + ;; + *) + _loaded="${_loaded:+${_loaded}:}${_file}" + . "${_file}" + ;; + esac + fi + done +done +unset _loaded _dir _file diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist index 8bea31212217..5ee5da8ee149 100644 --- a/etc/mtree/BSD.root.dist +++ b/etc/mtree/BSD.root.dist @@ -84,6 +84,8 @@ .. ppp .. + profile.d + .. rc.conf.d .. rc.d |
