added date time to keepalive
This commit is contained in:
parent
203319aba9
commit
155e56d7b6
25
keepalive.sh
25
keepalive.sh
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user