Skip to content

Instantly share code, notes, and snippets.

@abhishekr700
Created July 19, 2019 11:11
Show Gist options
  • Save abhishekr700/9926db6b5f22281325149f4dc3e13627 to your computer and use it in GitHub Desktop.
Save abhishekr700/9926db6b5f22281325149f4dc3e13627 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Copyright (C) 2019 Abhishek Ranjan <abhishekr700@gmail.com>
# SPDX-License-Identifier: GPL-3.0-or-later
## Usage: ./runAllCoins.sh
## Don't continue on errors
set -e
## Set Time
SECONDS=0
## Configurable Args
COINARR=("BTC" "EOS" "ETH" "TRX" "XRP")
FILE="test.js"
## Report Some Stuff
clear
echo -e "\n\n"
echo -e "========================================================"
echo -e "=== Run Arbitrage Multi Coin Script By @abhishekr700 ==="
echo -e "========================================================\n\n"
echo -e "=> Made for use in Arbitrage Market Maker Only"
echo -e "=> Licenced under GPL V3.0 or Later"
echo -e "=> Stealing other's work will make you a punk. Do not use this script without credits\n\n"
sleep 1
echo -e "File to run: $FILE"
echo -e "Coins:"
for index in ${!COINARR[*]}
do
printf "%4d: %s\n" $index ${COINARR[$index]}
done
echo -e "\nScript will run on above coins.If you want to continue, press ENTER"
## Wait for user to press ENTER
read
echo -e "=== Starting CoinWise Executions Now ===\n\n\n"
sleep 1
## Run BG node processes for various coins
echo -e "Will print PIDs of Different Coin Processes Now =>\n\n"
sleep 1
for item in ${COINARR[*]}
do
FILENAME=$(date +"%F_%T_$item")
node $FILE $item > $FILENAME.log &
echo "$item : $! : $FILENAME.log"
done
echo -e "\nAll processes have been started."
## Report Time
echo -e "\n\n\n====== SETUP COMPLETE ======"
BUILD_TIME=$SECONDS
echo "Script took $(($BUILD_TIME / 60)) minutes and $(($BUILD_TIME % 60)) seconds"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment