diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2019-12-11 21:14:03 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2019-12-11 21:14:03 +0100 |
commit | 2760dba480083977d179f095f47f28ec1913b9ec (patch) | |
tree | 569481702d6fa58845fc5e4c04f72993520f9492 /lib | |
parent | 2df6c231a41cae525f77a46e98ddf805f667ce5b (diff) | |
download | conky-2760dba480083977d179f095f47f28ec1913b9ec.tar.gz conky-2760dba480083977d179f095f47f28ec1913b9ec.tar.bz2 conky-2760dba480083977d179f095f47f28ec1913b9ec.tar.xz conky-2760dba480083977d179f095f47f28ec1913b9ec.zip |
Properly detect MySQL/slave desynchronization
Diffstat (limited to 'lib')
-rw-r--r-- | lib/adei/adei.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/adei/adei.sh b/lib/adei/adei.sh index 8519af7..fa9dfc3 100644 --- a/lib/adei/adei.sh +++ b/lib/adei/adei.sh @@ -35,7 +35,6 @@ function adei_query { url="$1&mysql=master" fi - resp=$(curl --proxy "" --location-trusted -sf -m "$timeout" "$url"); err=$? if [ $err -ne 0 ]; then resp=$(adei_query "$1" "ecode" "$timeout") @@ -56,9 +55,10 @@ function adei_query { function adei_format_query { local with_auth="${1:-1}" local query="$2" - local timeout=${3:-$adei_default_timeout} - local source=${4:-"$adei_source"} - local url="${5:-$adei_url}" + local database=${3:-master} # ignoring here, it will be handled separately by adei_query + local timeout=${4:-$adei_default_timeout} + local source=${5:-"$adei_source"} + local url="${6:-$adei_url}" auth="" [ $with_auth -gt 0 ] && auth="$adei_auth" @@ -71,7 +71,8 @@ function adei_format_query { function adei_simple_query { local req=$(adei_format_query 1 "$@") - adei_query "$req" "master" "$timeout"; err=$? + local database=${2:-master} + adei_query "$req" $database "$timeout"; err=$? return $err } |