From 66ae97d4b76a6934c8b45681d2644b1b6e114876 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Mon, 8 Jul 2019 19:21:30 +0700 Subject: [PATCH] Make splitfunds work on primary or secondary iguana port --- getiguanaport.sh | 10 ++++++++++ splitfunds.sh | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 getiguanaport.sh diff --git a/getiguanaport.sh b/getiguanaport.sh new file mode 100755 index 0000000..bf6951b --- /dev/null +++ b/getiguanaport.sh @@ -0,0 +1,10 @@ +#!/bin/bash +cd "${BASH_SOURCE%/*}" || exit + +server_type=$(cat server_type.txt) + +if [[ "${server_type}" = "primary" ]]; then + echo 7776 +elif [[ "${server_type}" = "secondary" ]]; then + echo 7779 +fi diff --git a/splitfunds.sh b/splitfunds.sh index 07c671a..5e15edf 100755 --- a/splitfunds.sh +++ b/splitfunds.sh @@ -4,6 +4,8 @@ cd "${BASH_SOURCE%/*}" || exit coin=$1 duplicates=$2 +iguana_port=$(./getiguanaport.sh) + utxo_size=10000 if [[ ${coin} = "GAME" ]]; then utxo_size=100000 @@ -12,4 +14,4 @@ if [[ ${coin} = "EMC2" ]]; then utxo_size=100000 fi -curl http://127.0.0.1:7776 --silent --data "{\"coin\":\"${coin}\",\"agent\":\"iguana\",\"method\":\"splitfunds\",\"satoshis\":${utxo_size},\"sendflag\":1,\"duplicates\":${duplicates}}" +curl "http://127.0.0.1:$iguana_port" --silent --data "{\"coin\":\"${coin}\",\"agent\":\"iguana\",\"method\":\"splitfunds\",\"satoshis\":${utxo_size},\"sendflag\":1,\"duplicates\":${duplicates}}"