now delay from .env instead of separate file

This commit is contained in:
Shihaam Abdul Rahman
2021-09-19 23:43:39 +05:00
parent 3e251a0429
commit 7464c54c5e

View File

@ -1,14 +1,6 @@
#!/bin/bash #!/bin/bash
source .env # import credentials, tg api, cookie path, bml api source .env # import credentials, tg api, cookie path, bml api
init(){
if [ ! -f delay ] # if delay file missing
then
echo 160 > delay # make delay file with 160 sec
fi
}
login(){ login(){
echo "" echo ""
echo "" echo ""
@ -72,7 +64,7 @@ CHECKDIFF2=$(echo $HISTORY | wc -c) ; echo $CHECKDIFF2 # check new history
} }
read_delay(){ read_delay(){
DELAY=$(cat delay) ; echo $DELAY # read delay file and get value DELAY=$(cat delay) ; echo $NORMAL_DELAY # read delay file and get value
} }
@ -139,7 +131,7 @@ then
send_tg send_tg
fi fi
else else
echo "Nothing new....Next check in $DELAY seconds" echo "Nothing new....Next check in $NORMAL_DELAY seconds"
fi fi
done done
} }
@ -147,7 +139,7 @@ done
infinite_loop(){ infinite_loop(){
while true; do while true; do
loop loop
sleep $DELAY # initiate delay read from delay file sleep $NORMAL_DELAY
done done
} }
infinite_loop infinite_loop