Created
July 18, 2019 10:21
-
-
Save cokia/1835165abc9b5faddaf380dbd03d308d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NODEOS_ROOT_DIR=/root/geth/eos_data/nodeos | |
CONFIG_DIR=/root/geth/eos-data/nodeos/config | |
DATA_DIR=/root/geth/eos-data/nodeos/data | |
LOG_DIR=/root/geth/eos_data/nodeos/log | |
## WALLET DIR 은 config.ini 파일 안의 datadir 로 정의!!! | |
## plugin들도 config.ini 파일 안에 정의!!! | |
## server address 도 config.ini 파일 안에 정의!!! | |
CURTIME=$(date +"%Y%m%d_%H%M%S") | |
LOG_FILENAME=$CURTIME".log" | |
PRODUCER_NAME=eosio | |
PROCESS_COUNT=$(ps -ef | grep nodeos | grep -v grep | awk '{print $2}' | wc -l) | |
if [ $PROCESS_COUNT -ne 0 ]; then | |
printf "이미 실행중인 nodeos가 존재합니다.\n" | |
exit 1 | |
fi | |
printf " OS 데몬을 시작 중...\n" | |
nohup nodeos -e -p $PRODUCER_NAME --config-dir $CONFIG_DIR --data-dir $DATA_DIR $1 &> $LOG_DIR/$LOG_FILENAME & | |
sleep 1s | |
PROCESS_COUNT=$(ps -ef | grep nodeos | grep -v grep | awk '{print $2}' | wc -l) | |
if [ $PROCESS_COUNT -ne 1 ]; then | |
printf "EOS 실행에 문제가 있습니다. (실행 실패 혹은 1개 이상의 프로세스가 실행됨)\n" | |
printf " * 로그파일 이름 : %s\n" $LOG_DIR"/"$LOG_FILENAME | |
echo | |
exit 1 | |
fi | |
printf "EOS 데몬이 시작되었습니다.\n" | |
printf " * 설정파일 경로 : \t%s\n" $CONFIG_DIR | |
printf " * 데이터 파일 경로 : \t%s\n" $DATA_DIR | |
printf " * 로그파일 이름 : \t%s\n" $LOG_DIR"/"$LOG_FIL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment