블럭 생성 자동화 ShellScript

YU YU·2021년 10월 6일
0

하도 맨날 적어야하길래 힘들어서 shellscript로 적어보았다.
그런데 이게 더 오래걸렸다는건 비밀...😂😂

데몬 실행 쉘스크립트

#!/bin/bash

./grootcoind -printtoconsole -conf=/home/seunghee/workspace/groot/execute/bin/grootcoin1.conf -datadir=/home/seunghee/workspace/groot/execute/bin/data1

이건 실행할 때 & 을 붙여서 백그라운드로 실행시키는게 좋을 거 같다.

클라이언트 실행 쉘스크립트

#! /bin/bash

while true
do
        ./grootcoin-cli -conf=/home/seunghee/workspace/groot/execute/bin/grootcoin1.conf generate 1;
        sleep 1;
done

sleep 1 안해주면 이상해진다고 한다. while문을 이용해서 무한 루프를 돌리는데 거의 while[true] 이렇게 적혀있어서 힘들었따. ㅠㅠ

결과


아주 자동으로 결과를 잘 내준다.

profile
코딩 재밌어요!

0개의 댓글

관련 채용 정보