Username: Password:

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - playmobitch

Pages: [1]
1
hi

little improvement and compatibility with 3.x release :


change the grep command line to grep -qw (because pair like STR won't launch if pair STRAT is already running so the -w flag force a whole word match)

Code: [Select]
#!/bin/bash
########### EDIT PLEASE ###############
# exact folder where gunbot and config files are
botfolder="/home/user/gunbot"
########## NO MORE EDIT ###############

############## DONT EDIT ##############
_dfiles="*-config.js"
red=`tput bold setaf 1`
green=`tput bold setaf 2`
blue=`tput bold setaf 4`
reset=`tput sgr0`
for f in $_dfiles
do
_name="${f##*/}"
_namef="${f%-*}"
echo "Checking if pair  $_namef is running..."
  if ! screen -list | grep -qw "$_namef"; then
  echo "${red}Pair not running.... ${green}Starting $_namef pair... ${reset}"
  screen -dmS $_namef
  screen -S $_namef -p 0 -X exec node $botfolder/index $_namef poloniex
  echo "Waiting 5S"
  sleep 1
  echo -n "...1"
  sleep 1
  echo -n "...2"
  sleep 1
  echo -n "...3"
  sleep 1
  echo -n "...4"
  sleep 1
  echo "${blue}...5!${reset}"
  echo "${green}Next PAIR${reset}"
  else
  echo "${green}Pair $_namef RUNNING${reset}"
  sleep 0.2
  fi

done

Pages: [1]