/etc/profile: Also source profile.d/*.sh files in data dirs

This allows packages to place files in data/profile.d to manipulate
the shell environment. They could already use settings/etc/profile.d,
but since there's no point in editing those files in most cases, placing
them there nonetheless doesn't make much sense.
This commit is contained in:
Ingo Weinhold 2013-12-04 23:20:35 +01:00
parent 5760191f1f
commit be012e2122
1 changed files with 10 additions and 0 deletions

View File

@ -106,6 +106,16 @@ function dir {
ls -lF "$@";
}
for dir in `findpaths -Re B_FIND_PATH_DATA_DIRECTORY profile.d 2> /dev/null`; do
for i in $dir/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
done
unset dir
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then