Silvia_Prada_Aprilia/vote-block-skripsi/geth-vote/stop.sh
2024-12-31 11:46:10 +07:00

28 lines
545 B
Bash

#!/bin/bash
# Function to kill any running bootnode process
kill_bootnode() {
local pid
pid=$(pgrep bootnode)
if [[ -n $pid ]]; then
echo "Stopping existing bootnode process (PID: $pid)..."
kill -9 $pid
fi
}
# Function to kill any running geth process
kill_geth() {
local pid
pid=$(pgrep geth)
if [[ -n $pid ]]; then
echo "Stopping existing geth process (PID: $pid)..."
kill -9 $pid
fi
}
# Kill any existing bootnode and geth processes
kill_bootnode
kill_geth
echo "All nodes and bootnode have been stopped."