From 7464c54c5e4ff51cb6ce9b81aaf9c530467ff2e0 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Sun, 19 Sep 2021 23:43:39 +0500 Subject: [PATCH] now delay from .env instead of separate file --- bml-tg-notify.sh | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/bml-tg-notify.sh b/bml-tg-notify.sh index 460f0f1..f873e4a 100755 --- a/bml-tg-notify.sh +++ b/bml-tg-notify.sh @@ -1,14 +1,6 @@ #!/bin/bash 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(){ echo "" echo "" @@ -72,7 +64,7 @@ CHECKDIFF2=$(echo $HISTORY | wc -c) ; echo $CHECKDIFF2 # check new history } 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 fi else - echo "Nothing new....Next check in $DELAY seconds" + echo "Nothing new....Next check in $NORMAL_DELAY seconds" fi done } @@ -147,7 +139,7 @@ done infinite_loop(){ while true; do loop - sleep $DELAY # initiate delay read from delay file + sleep $NORMAL_DELAY done } infinite_loop