This process is running foreground if possible to do it like that and just make sleep commands not interupt me but still do everything else as normal I just want to be able to continue my work while I'm waiting for the server to shutdown if I put sleep in the background it seems to do everything instantly? (thats when I put only sleep in the background of code).
sleep command will not work for my situation if I've figured this out correctly cause it could be any given time I put in and I need on elike 60 seconds or 30 seconds there to be a message how would i tell it to sleep for sure everytime will theres a minute left?get what I mean? and well i guess I can show you what I've got at least but it really doesn't tell you much. but here goes nothing!
gonna shorten the example up of unneccsary stuff because I am using ssh almost all the time because I'm on my laptop always either away from home and just home and the chair the computer desk has is broken (very uncomfortable) also if there are any mistakes in the code below i promise you they are not actually in the code itself since I can't figure out how to copy and paste the ssh terminal vim i can't just do a simple copy paste to my windows -.-
Code:
#!/bin/bash
screen -S PhantasyCraft -X stuff "say Server will restart in 30 seconds!^M"
sleep 15
. . .
#more of the same thing over and over again just different stuff and different sleep times
screen -S PhantasyCraft -X stuff "say Server will restart in 1 second!^M"
sleep 1
screen -S PhantasyCraft -X stuff "say Server will restart NOW!^M"
screen -S PhantasyCraft -X stuff "stop^M"
sleep 10
startphantasycraft
#the above startphantasycraft is a a symlink to a script i wrote that you don't need anything from it has no real effect on our results
Maybe it will help more then i think but like I say I wanna be able to type in like restartphantasycraft 89 and have it say restarting in 89 seconds and then the next mesage always be at 1 minute maybe and then next 30 seconds so I mean i need a count down of some sort to tell it when I hate 60 cause if that variable keeps changing i can't have a set sleep time and like if it keeps up to 300 seconds i want it to say like 300seconds til restart it needs to work interchangably