1
0
mirror of https://github.com/Llewellynvdm/CoinRate.git synced 2024-06-04 00:30:46 +00:00

Fixed the TargetAbove/Below switch

This commit is contained in:
Llewellyn van der Merwe 2017-12-29 18:52:11 +02:00
parent a30a3395a0
commit 38f608959a
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5

View File

@ -43,17 +43,17 @@ function main () {
# set send key # set send key
setSendKey setSendKey
# set target values and perform action if only TargetValue given # set target values and perform action if only TargetValue given
if (( "$TargetBelowValue" == 0 && "$TargetAboveValue" == 0)); if (( "$TargetBelow" == 0 && "$TargetAbove" == 0));
then then
getTarget "$TargetValue" "$value" 'setAction' getTarget "$TargetValue" "$value" 'setAction'
fi fi
# set target values and perform action if TargetBelowValue given # set target values and perform action if TargetBelowValue given
if (( "$TargetAboveValue" != 0 )); if (( "$TargetAbove" == 1 ));
then then
getTarget "$TargetAboveValue" "$value" 'setActionAbove' getTarget "$TargetAboveValue" "$value" 'setActionAbove'
fi fi
# set target values and perform action if TargetBelowValue given # set target values and perform action if TargetBelowValue given
if (( "$TargetBelowValue" != 0 )); if (( "$TargetBelow" == 1 ));
then then
getTarget "$TargetBelowValue" "$value" 'setActionBelow' getTarget "$TargetBelowValue" "$value" 'setActionBelow'
fi fi
@ -314,6 +314,8 @@ Target="USD"
TargetValue="17000" TargetValue="17000"
TargetBelowValue=0 TargetBelowValue=0
TargetAboveValue=0 TargetAboveValue=0
TargetBelow=0
TargetAbove=0
sendKey=$(TZ=":ZULU" date +"%m/%d/%Y" ) sendKey=$(TZ=":ZULU" date +"%m/%d/%Y" )
allowEcho=1 allowEcho=1
send=0 send=0
@ -388,9 +390,11 @@ while getopts ":c:C:h:v:A:B:b :a :t :s :q :l :" opt; do
;; ;;
B) B)
TargetBelowValue=$OPTARG TargetBelowValue=$OPTARG
TargetBelow=1
;; ;;
A) A)
TargetAboveValue=$OPTARG TargetAboveValue=$OPTARG
TargetAbove=1
;; ;;
b) b)
BelowValue=1 BelowValue=1