mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-26 08:35:17 +00:00
update script
This commit is contained in:
parent
06947eb307
commit
cfe77453c6
@ -5,18 +5,20 @@ start_process() {
|
|||||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||||
if [[ $arch == arm* ]]; then
|
if [[ $arch == arm* ]]; then
|
||||||
./node-$version-linux-arm64 &
|
./node-$version-linux-arm64 &
|
||||||
|
main_process_id=$!
|
||||||
else
|
else
|
||||||
./node-$version-linux-amd64 &
|
./node-$version-linux-amd64 &
|
||||||
|
main_process_id=$!
|
||||||
fi
|
fi
|
||||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
./node-$version-darwin-arm64 &
|
./node-$version-darwin-arm64 &
|
||||||
|
main_process_id=$!
|
||||||
else
|
else
|
||||||
echo "unsupported OS for releases, please build from source"
|
echo "unsupported OS for releases, please build from source"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
main_process_id=$!
|
|
||||||
local child_process_pid=$(pgrep -P $main_process_id)
|
echo "process started with PID $main_process_id"
|
||||||
echo "process started with PID $main_process_id and child PID $child_process_pid"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
is_process_running() {
|
is_process_running() {
|
||||||
@ -25,21 +27,12 @@ is_process_running() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
kill_process() {
|
kill_process() {
|
||||||
local process_count=$(ps -ef | grep "exe/node" | grep -v grep | wc -l)
|
local process_count=$(ps -ef | grep "node-$version" | grep -v grep | wc -l)
|
||||||
local process_pids=$(ps -ef | grep "exe/node" | grep -v grep | awk '{print $2}' | xargs)
|
local process_pids=$(ps -ef | grep "node-$version" | grep -v grep | awk '{print $2}' | xargs)
|
||||||
|
|
||||||
if [ $process_count -gt 0 ]; then
|
if [ $process_count -gt 0 ]; then
|
||||||
echo "killing processes $process_pids"
|
echo "killing processes $process_pids"
|
||||||
kill $process_pids
|
kill $process_pids
|
||||||
|
|
||||||
local child_process_count=$(pgrep -P $process_pids | wc -l)
|
|
||||||
local child_process_pids=$(pgrep -P $process_pids | xargs)
|
|
||||||
if [ $child_process_count -gt 0 ]; then
|
|
||||||
echo "killing child processes $child_process_pids"
|
|
||||||
kill $child_process_pids
|
|
||||||
else
|
|
||||||
echo "no child processes running"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "no processes running"
|
echo "no processes running"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user