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
![>](img/i_next.png)
![>](img/icons/cs2d.png)
![>](img/i_next.png)
![>](img/i_next.png)
shell for linux (debian)
21 AntwortenI 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.
![user](img/i_friend.png)
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!
2× editiert, zuletzt 13.12.14 10:54:54
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)
1× editiert, zuletzt 15.12.14 22:09:11
![user](img/i_friend.png)
![user](img/i_friend.png)
@
![user](img/i_friend.png)
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.
1× editiert, zuletzt 14.12.14 12:26:29
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.
![user](img/i_friend.png)
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
1× editiert, zuletzt 15.12.14 22:08:51
![user](img/i_friend.png)
This is not possible.
That was what I was talking about and yeah, it is possible.
![user](img/i_friend.png)