0

Here I am trying to create private ethereum instance using dockerfile. I want to open two terminals and run command1 in terminal1 and execute command2 in terminal2 only when command1 returns true.

Commands are shown below:

Command1: geth --verbosity 4 --port 3000 --networkid --datadir=/ethereum --rpc --rpcport 8545 --rpcaddr 127.0.0.1 --rpccorsdomain "*" --rpcapi "eth, net, web3 ,personal, admin, db,mine"

Command2: geth attach /ethereum/geth.ipc

But I couldn't get any document related to this. Please help me to resolve this issue and any help will be appreciated.

1 Answer 1

1

Shell command cannot return true, as command exit status is integer rather than boolean. By convention, zero exit status means success, while non-zero status means error.

Command returns exit status only when it exits. So once first command will return status, the first terminal will be free to execute another command, thus no need to use second terminal.

However, taking a look at your commands, I suggest that you just need to add console parameter at the end of the first command to be able to interact with your geth instance from terminal. This way you will not need second command at all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.