Added config file for general variables

This commit is contained in:
Yasin Kaya 2020-11-18 09:39:54 -08:00
parent 15537b5feb
commit c2b5866071
3 changed files with 9 additions and 8 deletions

View File

@ -1,5 +1,6 @@
#!/binenv bash
#!/bin/env bash
INTERVAL=60
DOUBLE_CHECK_WAIT=10
PING_TIMEOUT=9
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)

View File

@ -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:"

View File

@ -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