ask before stop server

This commit is contained in:
FezVrasta 2015-06-19 19:27:29 +02:00
parent cac29c54b8
commit 3eb51f0d1b

View File

@ -57,10 +57,13 @@ doStart() {
# stop function
doStop() {
screen -S "$servicename" -p 0 -X stuff "quit$(printf \\r)"
# screen -S "$servicename" -X quit
sleep 30
echo "$timestamp: stop" >> "$logdir/arkserver.log"
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
sleep 30
echo "$timestamp: stop" >> "$logdir/arkserver.log"
fi
}
# install function