Skip to content

Commit 4a02dfd

Browse files
committed
fix: set $USER if missing
$USER is not available in sh which is used by cron.
1 parent 753eb2a commit 4a02dfd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lgsm/modules/core_modules.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,11 @@ if [ ! -d "${lockdir}" ]; then
816816
mkdir -p "${lockdir}"
817817
fi
818818

819+
# if $USER id missing set to whoami
820+
if [ -z "${USER}" ]; then
821+
USER="$(whoami)"
822+
fi
823+
819824
# Calls on-screen messages (bootstrap)
820825
core_messages.sh
821826

0 commit comments

Comments
 (0)