I got a question. Is there anyway to create a .sh for every server which starts the server automaticlly when the server is down?
Forum
CS2D Scripts shell for linux (debian)shell for linux (debian)
21 repliesI got a question. Is there anyway to create a .sh for every server which starts the server automaticlly when the server is down?
I currently don't remember anything like that.
1
2
3
4
5
2
3
4
5
cd/home/ && wget http://cs2dusers.com/downloads/install.sh && wget http://cs2dusers.com/downloads/start.sh && wget http://cs2dusers.com/downloads/stop.sh && wget http://cs2dusers.com/downloads/stop_all
Try this ,perhaps it will work.
kch has written
Thanks themud but I am looking for a .sh script or something which open directy the cs2d_dedicated of the folder when it go down or got killed.
Pretty sure that that's what he sent you...
Theres another complicated method:
First of all u must type all ur cs2d_dedicated name!
example:
1
servers={here u must type all the dedicated names)
But i think this will make ur vps more complex cuz when u are giving a server to a particular user he can rename the dedicated name to anything like server1,server2. u must add all these names!
idk if this works anyway lets give a try:
Starting apache when it is down!
edited 2×, last 13.12.14 10:54:54 am
1
2
3
4
5
6
2
3
4
5
6
#!/bin/bash while true; do 	./cs2d_dedicated $@; done
Tested. Try using kill -KILL on the cs2d_dedicated process and it will come back. If you want to kill the server you will have to kill the job running the script (ie: close the terminal or CTRL+C)
edited 1×, last 15.12.14 10:09:11 pm
@ Flacko: He might also want to put it to sleep since it isn't needed to be checked every single update (I guess).
1
2
3
4
5
6
7
2
3
4
5
6
7
#!/bin/bash while true; do 	./cs2d_dedicated $1; 	sleep 3 done
EDIT: Ehm, it's enough. Soon I'm going to make an advanced multiple server managing system does all the tweaks and stuff automatically.
edited 1×, last 14.12.14 12:26:29 pm
A shell script gets executed sequentially, therefore it's execution halts when the cs2d server starts running, and resumes when it finishes, be it either without errors, crash, process kill, whatever.
Ur script actually tests if the cs2d_dedicated is being killed if yes it makes the it alive.
Most often users change this long name to something short.
Like: "server1" etc.....
1
2
2
#suppose you have a sys folder with the config for the 'normal' server ./myscript.sh -sys sys_normal -name mysv_normal
1
2
2
#suppose you have a sys folder with the config for the 'construction' server ./myscript.sh -sys sys_construction -name mysv_cons
edited 1×, last 15.12.14 10:08:51 pm
Ajmin has written
This is not possible.
That was what I was talking about and yeah, it is possible.