Adding new rates.sx feature to cryptocurrency
This commit is contained in:
parent
bb2103081d
commit
40df20fb85
|
@ -254,11 +254,14 @@ EOF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while getopts "of:uvh" opt; do
|
while getopts "c:of:uvh" opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
\?) echo "Invalid option: -$OPTARG" >&2
|
\?) echo "Invalid option: -$OPTARG" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
c)
|
||||||
|
currency=$OPTARG
|
||||||
|
;;
|
||||||
h) usage
|
h) usage
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
@ -305,8 +308,13 @@ fi
|
||||||
|
|
||||||
getConfiguredClient || exit 1
|
getConfiguredClient || exit 1
|
||||||
checkInternet || exit 1
|
checkInternet || exit 1
|
||||||
|
link="rate.sx"
|
||||||
if [[ $fiat =~ [a-zA-Z] ]]; then
|
if [[ $fiat =~ [a-zA-Z] ]]; then
|
||||||
httpGet $fiat.rate.sx
|
link="$fiat.$link"
|
||||||
else
|
|
||||||
httpGet rate.sx
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $currency =~ [a-zA-Z] ]]; then
|
||||||
|
link="$link/$currency"
|
||||||
|
fi
|
||||||
|
|
||||||
|
httpGet $link
|
||||||
|
|
Loading…
Reference in New Issue