mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-03 11:53:41 +02:00
Adding start/stop scripts.
This commit is contained in:
parent
925db35646
commit
68426a8b5f
2 changed files with 29 additions and 0 deletions
12
scripts/start.sh
Normal file
12
scripts/start.sh
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash
|
||||||
|
BIN=bin/eosio-ship-trace-reader
|
||||||
|
|
||||||
|
DIR=$(dirname $(realpath $0))
|
||||||
|
cd "$DIR"
|
||||||
|
|
||||||
|
date
|
||||||
|
./stop.sh
|
||||||
|
timestamp=`date +%s`
|
||||||
|
$BIN -p ./eosio-ship-trace-reader.pid 2> logs/$timestamp.log &
|
||||||
|
rm -f out.log
|
||||||
|
ln -s logs/$timestamp.log out.log
|
||||||
17
scripts/stop.sh
Normal file
17
scripts/stop.sh
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
PIDFILE="$(pwd)/eosio-ship-trace-reader.pid"
|
||||||
|
|
||||||
|
if [ -f "$PIDFILE" ]; then
|
||||||
|
pid=$(cat "$PIDFILE")
|
||||||
|
echo $pid
|
||||||
|
kill $pid
|
||||||
|
rm -r "$PIDFILE"
|
||||||
|
echo -ne "Stopping process"
|
||||||
|
while true; do
|
||||||
|
[ ! -d "/proc/$pid/fd" ] && break
|
||||||
|
echo -ne "."
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
echo -ne "\rProcesss stopped. \n"
|
||||||
|
fi
|
||||||
Loading…
Add table
Add a link
Reference in a new issue