Browse Source

fix: set $USER if missing

$USER is not available in sh which is used by cron.
Daniel Gibbs 2 năm trước cách đây
mục cha
commit
4a02dfd382
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      lgsm/modules/core_modules.sh

+ 5 - 0
lgsm/modules/core_modules.sh

@@ -816,6 +816,11 @@ if [ ! -d "${lockdir}" ]; then
 	mkdir -p "${lockdir}"
 fi
 
+# if $USER id missing set to whoami
+if [ -z "${USER}" ]; then
+	USER="$(whoami)"
+fi
+
 # Calls on-screen messages (bootstrap)
 core_messages.sh