-
Notifications
You must be signed in to change notification settings - Fork 13
/
stop.sh
37 lines (26 loc) · 860 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
#!/bin/bash
################################################################################
#
# Scrip Created by http://CryptoLions.io
# https://github.com/CryptoLions/scripts/
#
###############################################################################
DIR="/path/to/data-dir"
if [ -f $DIR"/eosd.pid" ]; then
pid=`cat $DIR"/eosd.pid"`
echo $pid
kill $pid
echo -ne "Stoping Node"
while true; do
[ ! -d "/proc/$pid/fd" ] && break
echo -ne "."
sleep 1
done
rm -r $DIR"/eosd.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 "\rNode Stopped. \n"
fi