#!/bin/bash
#  ___  _    _          _ __      
# / __|| |_ | |_   ___ | '_ \ ___ 
# \__ \|  _||   \ / _ \| .__// -_)
# |___/ \__||_||_|\___/|_|   \___|

## ./script "WALLET_ID"

amd64_script="https://git.sthope.dev/sthope/DockerContainer-Noso/raw/branch/master/files/amd64/noso-go"
amd64_nano="https://git.sthope.dev/sthope/DockerContainer-Noso/raw/branch/master/files/amd64/noso-go.sh"

noso_script="noso-go"
noso_nano="noso-go.sh"

WALLET="$1"
CPU=4

# NOSO_DIR="~/noso/"
NOSO_DIR="noso"

clear

mkdir -p $NOSO_DIR

cd $NOSO_DIR

wget -q "$amd64_script"
wget -q "$amd64_nano"

chmod a+x noso-go*


variable=( '${WALLET}' '${CPU}' )

text=$(cat $noso_nano)
while read line
do
  value=$(eval echo $line)  
  text=$(sed "s/$line/$value/g" <<< "$text")
done < "$variable"
echo "$text" > output.sh