#!/bin/bash

export no_proxy=127.0.0.1,localhost,${no_proxy}
export NO_PROXY=${no_proxy}

if [ "x$1" == "x" ]; then

  echo "HELP: run task, task could be:"
  echo "  broker          start the http broker"
  echo "  center          start the sample center"
  echo "  hub             start the sample hub"
  echo "  edison          start the sample hub in edison (it includes real things)"
  echo "  skartkit        start the startkit hub in edison"
  echo "  grove           start the hub for wio-link"
  echo "  lattepanda      start the hub for lattepanda"
  echo "  orion           start the hub for orion + edison"
  echo "  tank            start the hub for Official Edison Arduino + tank"
  echo "  tank_romeo      start the hub for Edison Romeo + tank"
  exit 1

fi

case $1 in 
  broker)
    node ./node_modules/hope-http-broker/bin/start_broker 16666
    ;;
  center)
    ./center ./node_modules/hope-demo/center/config.json
    ;;
  hub)
    ./hub ./node_modules/hope-demo/mockup/hub_a/config.json
    ;;
  hub_b)
    ./hub ./node_modules/hope-demo/mockup/hub_b/config.json
    ;;
  edison)
    ./hub ./node_modules/hope-demo/edison/config.json
    ;;
  startkit)
    ./hub ./node_modules/hope-demo/startkit/config.json
    ;;
  grove)
    ./hub ./node_modules/hope-demo/grove_auto/config.json
    ;;
  lattepanda)
    ./hub ./node_modules/hope-demo/lattepanda/config.json
    ;;
  orion)
    ./hub ./node_modules/hope-demo/makeblock/config.json
    ;;
  tank)
    ./hub ./node_modules/hope-demo/tank/config.json
    ;;
  tank_romeo)
    ./hub ./node_modules/hope-demo/tank_romeo/config.json
    ;;
esac
