Kill the old blockexplorer harder

This commit is contained in:
Michael Vines 2019-09-19 10:35:06 -07:00
parent 8d94972d88
commit 9917ece826
No known key found for this signature in database
GPG Key ID: 33F4FDEC4E0E88BD
1 changed files with 8 additions and 1 deletions

View File

@ -271,8 +271,15 @@ EOF
cat > ~/solana/restart-explorer <<EOF
#!/bin/bash -ex
cd ~/solana
npm install @solana/blockexplorer@1
if [[ -f blockexplorer.pid ]]; then
pgid=\$(ps opgid= \$(cat blockexplorer.pid) | tr -d '[:space:]')
if [[ -n \$pgid ]]; then
kill -- -\$pgid
fi
fi
killall node || true
npm install @solana/blockexplorer@1
export BLOCKEXPLORER_GEOIP_WHITELIST=$PWD/net/config/geoip.yml
npx solana-blockexplorer > blockexplorer.log 2>&1 &
echo \$! > blockexplorer.pid