Skip to content

Commit

Permalink
feat: Prevent double sourcing of user-motd (#289)
Browse files Browse the repository at this point in the history
Signed-off-by: Drew Moseley <[email protected]>
  • Loading branch information
drewmoseley authored Jul 14, 2024
1 parent 59e80d9 commit 446a8f7
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions build/ublue-os-just/etc-profile.d/user-motd.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
if test -d "$HOME"; then
if test ! -e "$HOME"/.config/no-show-user-motd; then
if test -x "/usr/libexec/ublue-motd"; then
/usr/libexec/ublue-motd
elif test -s "/etc/user-motd"; then
cat /etc/user-motd
# Prevent doublesourcing
if [ -z "$USERMOTDSOURCED" ]; then
USERMOTDSOURCED="Y"
if test -d "$HOME"; then
if test ! -e "$HOME"/.config/no-show-user-motd; then
if test -x "/usr/libexec/ublue-motd"; then
/usr/libexec/ublue-motd
elif test -s "/etc/user-motd"; then
cat /etc/user-motd
fi
fi
fi
fi
fi

0 comments on commit 446a8f7

Please sign in to comment.