Skip to content

Commit

Permalink
only restart/rebuild client when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
wcannon committed Jan 13, 2022
1 parent af07c7f commit e3ddf47
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions run-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ function exit_node()
trap exit_node SIGINT

echo "Running client node..."
$COMMAND &

while :
do
echo "Checking for updates..."
git stash
rm Cargo.lock
STATUS=$(git pull)

echo "Running the node..."

if [ "$STATUS" != "Already up to date." ]; then
echo "Updated code found, rebuilding and relaunching client node"
cargo clean
kill -INT $!; sleep 2; $COMMAND &
fi

sleep 1800

$COMMAND & sleep 1800; kill -INT $!

sleep 2;
done

0 comments on commit e3ddf47

Please sign in to comment.