Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions scripts/create-smtp-cfg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
(set -o igncr) 2>/dev/null && set -o igncr; # this comment is required
# The above line ensures that the script can be run on Cygwin/Linux even with Windows CRNL

# TODO: Change location of script depending on Windows or Linux. Only Windows is handled now.

# Check command line arguments for the help command, or if 2 commands were not given
if [ $# -eq 1 ] && [ $1 = "--help" ]; then
echo "Help"
exit 0
elif [ $# -ne 2 ]; then
echo " Usage: ./create-smtp-cfg.sh <Email_Account_ID> <Email_Account_Password>"
echo " or ./create-smtp-cfg.sh --help for more information"
exit 1
else
accountID=$1
accountPassword=$2
fi

#
mailPassFile=${APPDATA}/tstool/.smtp.cfg
if [ ! -f ${mailPassFile} ]; then
touch ${mailPassFile}
chmod 600 ${mailPassFile}
fi

# Write the user ID and password to the file. Overwrite each time.
echo ${accountID}:${accountPassword} > ${mailPassFile}
Loading