#!/bin/bash # Send OTP # # get directory where script is located: cd ${0%/*} Logfile=SendOTP.log printf '=====================' >> $Logfile date >> $Logfile echo OTP:$1 IPaddress:$2 Email:$3 MobilePhone:$4 >> $Logfile if [ $4 == "email" ]; then echo SendSMTPmail.dll is not configured! >> $Logfile else # A1: https://www.a1.net/prosms #dotnet httpGet.dll "https://sms.b2b.telekom.at/mssms/rest/sendSms.do?username=xxx&password=xxx&recipients=%4&msgtext=Your_One_Time_Password_is_%1" -fc -nochk > SendOTP$$.txt # esendex: https://www.esendex.com dotnet HttpGet.dll "https://www.esendex.com/secure/messenger/formpost/SendSMS.aspx?username=xxx@xxx&account=EX0xxxxxx&password=xxx&recipient=$4&body=Your_One_Time_Password_is_$1&plaintext=1" -fc -nochk > SendOTP$$.txt fi echo ERRORLEVEL=$? >> $Logfile if [ -f SendOTP$$.txt ]; then cat SendOTP$$.txt >> $Logfile printf '\n' >> $Logfile rm SendOTP$$.txt fi