Skip to content

Commit

Permalink
Code Improvments
Browse files Browse the repository at this point in the history
Fine-tuning code.
  • Loading branch information
Martinski4GitHub committed Nov 13, 2024
1 parent 78eaad5 commit 48a9558
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
13 changes: 9 additions & 4 deletions EMail/CustomEMailFunctions.lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
# email notifications using AMTM email configuration file.
#
# Creation Date: 2020-Jun-11 [Martinski W.]
# Last Modified: 2024-Jul-17 [Martinski W.]
# Last Modified: 2024-Nov-13 [Martinski W.]
######################################################################

if [ -z "${_LIB_CustomEMailFunctions_SHELL_:+xSETx}" ]
then _LIB_CustomEMailFunctions_SHELL_=0
else return 0
fi

CEM_LIB_VERSION="0.9.22"
CEM_LIB_VERSION="0.9.23"
CEM_TXT_VERFILE="cemVersion.txt"

CEM_LIB_REPO_BRANCH="master"
Expand Down Expand Up @@ -72,7 +72,11 @@ PASSWORD="" emailPwEnc=""
# Custom Additions ##
CC_NAME="" CC_ADDRESS=""

[ -f "$amtmEMailConfFile" ] && . "$amtmEMailConfFile"
if [ -s "$amtmEMailConfFile" ]
then
dos2unix "$amtmEMailConfFile"
. "$amtmEMailConfFile"
fi

#-----------------------------------------------------------#
_DoReInit_CEM_()
Expand Down Expand Up @@ -217,7 +221,7 @@ CheckEMailConfigFileFromAMTM_CEM_()
{
amtmIsEMailConfigFileEnabled=false

if [ ! -f "$amtmEMailConfFile" ]
if [ ! -s "$amtmEMailConfFile" ]
then
_PrintMsg_CEM_ "\n**ERROR**: Unable to send email notifications."
_PrintMsg_CEM_ "\nAMTM email configuration file is not yet set up.\n"
Expand All @@ -241,6 +245,7 @@ CheckEMailConfigFileFromAMTM_CEM_()
return 1
fi

chmod 640 "$amtmEMailConfFile" "$amtmEMailPswdFile"
amtmIsEMailConfigFileEnabled=true
return 0
}
Expand Down
5 changes: 3 additions & 2 deletions EMail/DownloadCEMLibraryFile.lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
# but do *NOT* change the variable names.
#
# Creation Date: 2024-Jul-08 [Martinski W.]
# Last Modified: 2024-Aug-03 [Martinski W.]
# Last Modified: 2024-Nov-13 [Martinski W.]
####################################################################

if [ -z "${_LIB_DownloadCEMLibraryFile_SHELL_:+xSETx}" ]
then _LIB_DownloadCEMLibraryFile_SHELL_=0
else return 0
fi

CEM_DL_HELPER_VERSION="0.1.9"
CEM_DL_HELPER_VERSION="0.1.10"

CEM_LIB_BRANCH="master"
CEM_LIB_URL2="https://raw.githubusercontent.com/MartinSkyW/CustomMiscUtils/${CEM_LIB_BRANCH}/EMail"
Expand Down Expand Up @@ -67,6 +67,7 @@ _DownloadLibraryScript_CEM_()
return 1
else
mv -f "$libScriptFileDL" "$CEM_LIB_FILE_PATH"
dos2unix "$CEM_LIB_FILE_PATH"
chmod 755 "$CEM_LIB_FILE_PATH"
. "$CEM_LIB_FILE_PATH"
if "$cemIsVerboseMode" || { [ "$2" -gt 1 ] && "$doDL_ShowErrorMsgs" ; }
Expand Down
2 changes: 1 addition & 1 deletion EMail/cemVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.22
0.9.23

0 comments on commit 48a9558

Please sign in to comment.