added date time to keepalive

This commit is contained in:
Shihaam Abdul Rahman 2024-12-09 00:37:19 +05:00
parent 203319aba9
commit 155e56d7b6
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

View File

@ -1,10 +1,21 @@
#!/bin/bash
while true; do
source .env 2> /dev/null
KEEP_ALIVE=$(curl -s 'https://faisanet.mib.com.mv/aProfile/keepAlive' \
-X 'POST' \
-H "cookie: ql_0=${QL_0}; IBSID=${IBSID}")
echo $KEEP_ALIVE
sleep $SLEEP
source .env 2> /dev/null
# Get current date and time
CURRENT_TIME=$(date -u '+%Y-%m-%dT%H:%M:%S.%3NZ')
# Make the keep-alive request
KEEP_ALIVE=$(curl -s 'https://faisanet.mib.com.mv/aProfile/keepAlive' \
-X 'POST' \
-H "cookie: ql_0=${QL_0}; IBSID=${IBSID}")
# Remove the last closing brace from KEEP_ALIVE
KEEP_ALIVE_MODIFIED=${KEEP_ALIVE%?}
# Combine timestamp with the keep-alive response
echo "$KEEP_ALIVE_MODIFIED, \"timestamp\":\"$CURRENT_TIME\"}"
# Sleep for the specified duration
sleep $SLEEP
done