Skip to content

Commit

Permalink
修改sample/run.sh 一键运行脚本
Browse files Browse the repository at this point in the history
1. run.sh  root 用户会遇到没有 /usrllocal/bin 路径的问题
2. 非root用户没有权限创建根目录
3. start模板错误
4. build.sh 中 make install 会安装一个由动态内存的执行文件,所以采用直接拷贝
  • Loading branch information
WEBANK\kimjin committed Dec 21, 2017
1 parent c3bfba5 commit 4f4bd91
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion build.sh
Expand Up @@ -39,7 +39,8 @@ fi

make -j2

make install
# sudo make install
sudo cp eth/bcoseth /usr/local/bin/

cd ..
cd ./tool
Expand Down
16 changes: 15 additions & 1 deletion sample/run.sh
@@ -1,6 +1,20 @@
#!/bin/sh

if [ -d "/bcos-data" ]; then
sudo rm -rf /bcos-data
fi

if [ `whoami` = "root" ];then
export PATH="${PATH}:/usr/local/bin"
else
user=`whoami`
group=`groups`
sudo mkdir /bcos-data
sudo chown ${user}:${group} /bcos-data
fi

node init.js node0.sample node1.sample
chmod +x /bcos-data/node0/start0.sh
chmod +x /bcos-data/node1/start1.sh
sh /bcos-data/node0/start0.sh &
sh /bcos-data/node1/start1.sh &
sh /bcos-data/node1/start1.sh &
2 changes: 1 addition & 1 deletion sample/start.sh.template
@@ -1,3 +1,3 @@
#!/bin/sh
bcoseth --genesis {genesis} --config {config}
nohup bcoseth --genesis {genesis} --config {config} >> out.log 2>&1 &

0 comments on commit 4f4bd91

Please sign in to comment.