forked from CryptoLions/EOS-MainNet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stop.sh
37 lines (28 loc) · 822 Bytes
/
stop.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
################################################################################
#
# Scrip Created by http://CryptoLions.io
# For EOS mainnet
#
# https://github.com/CryptoLions/EOS-MainNet
#
###############################################################################
DIR="/opt/EOSmainNet"
if [ -f $DIR"/nodeos.pid" ]; then
pid=`cat $DIR"/nodeos.pid"`
echo $pid
kill $pid
echo -ne "Stoping Nodeos"
while true; do
[ ! -d "/proc/$pid/fd" ] && break
echo -ne "."
sleep 1
done
rm -r $DIR"/nodeos.pid"
DATE=$(date -d "now" +'%Y_%m_%d-%H_%M')
if [ ! -d $DIR/logs ]; then
mkdir $DIR/logs
fi
tar -pcvzf $DIR/logs/stderr-$DATE.txt.tar.gz stderr.txt stdout.txt
echo -ne "\rNodeos Stopped. \n"
fi