profile.d: don't try to source non-existent os-release file

When /etc/os-release does not exist we directly try to source
/usr/lib/os-release. This causes a 'No such file or directory'
error when entering a toolbox which has neither.

Fix this by checking for the presence of /usr/lib/os-release before
sourcing it, just like what is done for /etc/os-release.

Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
This commit is contained in:
Patrick Talbert 2024-04-02 13:24:07 +02:00
parent 640ca4cf3d
commit 4c9383ec63
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ toolbox_welcome_stub="$toolbox_config/toolbox-welcome-shown"
eval $(
if [ -f /etc/os-release ]; then
. /etc/os-release
else
elif [ -f /usr/lib/os-release ]; then
. /usr/lib/os-release
fi