Properly closes the active screen session and the process inside it when the stop function is called.

This commit is contained in:
Marius Linge 2015-06-20 06:22:01 +02:00
parent 1086d21098
commit 529576e6fa

View File

@ -57,8 +57,7 @@ doStart() {
doStop() {
read -p "This operation will quit the server without saving, are your really sure?" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
screen -S "$servicename" -p 0 -X stuff "quit$(printf \\r)"
# screen -S "$servicename" -X quit
screen -X -S "$servicename" stuff "^C"
sleep 30
echo "$timestamp: stop" >> "$logdir/arkserver.log"
fi