From c2b58660711535f04026390e7743068b6a31b8e6 Mon Sep 17 00:00:00 2001 From: Yasin Kaya Date: Wed, 18 Nov 2020 09:39:54 -0800 Subject: [PATCH] Added config file for general variables --- ppp_installer/configs.sh | 9 +++++---- ppp_installer/functions.sh | 6 +++--- ppp_installer/test.sh | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ppp_installer/configs.sh b/ppp_installer/configs.sh index 4d731e5..f127ae3 100644 --- a/ppp_installer/configs.sh +++ b/ppp_installer/configs.sh @@ -1,5 +1,6 @@ -#!/binenv bash +#!/bin/env bash -INTERVAL=60 -DOUBLE_CHECK_WAIT=10 -PING_TIMEOUT=9 \ No newline at end of file +INTERVAL=60 # Seconds, Interval between two connection check of internet +DOUBLE_CHECK_WAIT=10 # Seconds, wait time for double check when the connection is down +PING_TIMEOUT=9 # Seconds, Timeout of ping command +NETWORK_CHECK_TIMEOUT=300 # Count, Check network for ($NETWORK_TIMEOUT x 2 Seconds) \ No newline at end of file diff --git a/ppp_installer/functions.sh b/ppp_installer/functions.sh index 9d66796..2a03043 100644 --- a/ppp_installer/functions.sh +++ b/ppp_installer/functions.sh @@ -1,5 +1,7 @@ #!/bin/env bash +source configs.sh + function debug() { echo $(date "+%Y/%m/%d - %H:%M:%S :") "$1" @@ -7,12 +9,10 @@ function debug() function check_network() { - NETWORK_TIMEOUT=300 # Check network for ($NETWORK_TIMEOUT x 2 Seconds) - # Check the network is ready debug "Checking the network is ready..." - for i in {1..$NETWORK_TIMEOUT}; do + for i in {1..$NETWORK_CHECK_TIMEOUT}; do NETWORK_OK=0 debug "SIM Status:" diff --git a/ppp_installer/test.sh b/ppp_installer/test.sh index b46f5ec..22d4342 100644 --- a/ppp_installer/test.sh +++ b/ppp_installer/test.sh @@ -1,7 +1,7 @@ #!/bin/env bash source functions.sh -source config.sh +source configs.sh echo "PING TIMEOUT: " $PING_TIMEOUT echo "DOUBLE CHECK WAIT: " $DOUBLE_CHECK_WAIT