1
0
mirror of https://github.com/Llewellynvdm/CoinRate.git synced 2024-11-24 19:37:32 +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
setSendKey
# set target values and perform action if only TargetValue given
if (( "$TargetBelowValue" == 0 && "$TargetAboveValue" == 0));
if (( "$TargetBelow" == 0 && "$TargetAbove" == 0));
then
getTarget "$TargetValue" "$value" 'setAction'
fi
# set target values and perform action if TargetBelowValue given
if (( "$TargetAboveValue" != 0 ));
if (( "$TargetAbove" == 1 ));
then
getTarget "$TargetAboveValue" "$value" 'setActionAbove'
fi
# set target values and perform action if TargetBelowValue given
if (( "$TargetBelowValue" != 0 ));
if (( "$TargetBelow" == 1 ));
then
getTarget "$TargetBelowValue" "$value" 'setActionBelow'
fi
@ -314,6 +314,8 @@ Target="USD"
TargetValue="17000"
TargetBelowValue=0
TargetAboveValue=0
TargetBelow=0
TargetAbove=0
sendKey=$(TZ=":ZULU" date +"%m/%d/%Y" )
allowEcho=1
send=0
@ -388,9 +390,11 @@ while getopts ":c:C:h:v:A:B:b :a :t :s :q :l :" opt; do
;;
B)
TargetBelowValue=$OPTARG
TargetBelow=1
;;
A)
TargetAboveValue=$OPTARG
TargetAbove=1
;;
b)
BelowValue=1