Pipe into while loops

This commit is contained in:
Luke Childs 2018-07-06 07:15:59 +07:00
parent cd7fd0552e
commit 0467e742e3
2 changed files with 4 additions and 6 deletions

View File

@ -3,14 +3,13 @@ set -eo pipefail
# You can now add delay line to pubkey.txt file # You can now add delay line to pubkey.txt file
source pubkey.txt source pubkey.txt
assetchain_args=`./listassetchainparams`
overide_args="$@" overide_args="$@"
seed_ip=`getent hosts zero.kolo.supernet.org | awk '{ print $1 }'` seed_ip=`getent hosts zero.kolo.supernet.org | awk '{ print $1 }'`
komodo_binary='./komodod' komodo_binary='./komodod'
if [ -z "$delay" ]; then delay=20; fi if [ -z "$delay" ]; then delay=20; fi
while read args; do ./listassetchainparams | while read args; do
gen="" gen=""
if [ $[RANDOM % 10] == 1 ]; then if [ $[RANDOM % 10] == 1 ]; then
gen=" -gen" gen=" -gen"
@ -18,4 +17,4 @@ while read args; do
$komodo_binary $gen $args $overide_args -pubkey=$pubkey -addnode=$seed_ip & $komodo_binary $gen $args $overide_args -pubkey=$pubkey -addnode=$seed_ip &
sleep $delay sleep $delay
done <<< "$assetchain_args" done

View File

@ -1,9 +1,8 @@
#!/bin/bash #!/bin/bash
set -eo pipefail set -eo pipefail
assetchains=`./listassetchains`
komodo_cli='./komodo-cli' komodo_cli='./komodo-cli'
while read chain; do ./listassetchains | while read chain; do
$komodo_cli --ac_name=$chain stop $komodo_cli --ac_name=$chain stop
done <<< "$assetchains" done