#!/usr/bin/env python

# NOTE: to reset a password, type something like
# ./hub start --passwd wstein@gmail.com --database_nodes 10.1.1.2,10.1.2.2,10.1.3.2,10.1.4.2 --keyspace salvus
# Better -- use the reset_password script in /mnt/snap on 10.1.1.3..., TODO: put that in scripts/ here.

import os, sys

id = ''
for i in range(1, len(sys.argv)):
    if sys.argv[i] == '--id':
        id = sys.argv[i+1]
        del sys.argv[i]
        break

# node node_modules/hub.js $@

args = ' '.join(sys.argv[1:])
if id != '':
    cmd="cp node_modules/hub.js node_modules/hub%s.js && node node_modules/hub%s.js %s"%(id, id, args)
else:
    cmd = "node node_modules/hub.js " + args
print cmd
os.system(cmd)
