# /usr/local/bin/2fa-sender.sh
# This is a script for sending two factor auth token via a free API provided by cloudradar GmbH
# Check https://kb.rport.io/install-the-rport-server/enable-two-factor-authentication
# and learn how to use your own SMTP server or alternative delivery methods
RESPONSE=$(curl -Ss https://free-2fa-sender.rport.io \
-F email=${RPORT_2FA_SENDTO} \
-F token=${RPORT_2FA_TOKEN} \
-F ttl=${RPORT_2FA_TOKEN_TTL} \
-F url=https://dnpefye735n8.users.rport.io 2>&1)
if echo $RESPONSE|grep -q "Message sent";then
echo "Token sent via email"