Batchuri pornire, restart, stop
Moderators: Moderatori ajutatori, Moderatori
-
- Membru, skill +2
- Posts: 550
- Joined: 31 Mar 2013, 15:18
- Detinator Steam: Da
- Has thanked: 35 times
- Been thanked: 21 times
Ce server?
Foloseste un editor (ex: nano):
* Primul rand din fisier trebuie sa fie urmatorul:
* Dupa poti sa creezi niste variabile (ex: numele executabilului de la server,localizarea filelor,server.cfg, etc.)
* Un C pentru fiecare comanda start,stop.
* Conditia if
Foloseste un editor (ex: nano):
Code: Select all
sudo apt-get install nano #pentru Debian
Code: Select all
nano numescript.sh #numescript.sh este numele scriptului tau
Code: Select all
#!/bin/bash
Code: Select all
director='/home/user/server' # Inlocuiesti /home/user/server cu directorul unde este server tau.
server='hlds_run' # hlds_run in caz ca folosesti un server de CS.
start=`comanda_prin_care_pornesti_serverul` # Pui intre ghilimele comanda de start
stop=`comanda_prin_care_opresti_serverul` # Pui intre ghilimele comanda de stop
Code: Select all
start() {
Code: Select all
stop() {
- start | Afiseaza codul
- stop | Afiseaza codul
- case | Afiseaza codul
- numescript.sh | Afiseaza codul
Code: Select all
chmod 755 numescript.sh
Last edited by Clint on 17 Jan 2014, 20:34, edited 1 time in total.
Stay chill.
-
- Fost moderator
- Posts: 4648
- Joined: 12 Jun 2012, 15:18
- Detinator Steam: Da
- Reputatie: Fost moderator
- Has thanked: 258 times
- Been thanked: 38 times
- Contact:
Server de cs 1.6 vreau sa instalez, dar nu reusesc ca tot imi da crash, l-am instalat prin steamcmd, iar fara batchuri nu reusesc nimic daca vreau sa fac mai multe servere.
Cum pot completa start si stop?
start = ./hlds_run -game cstrike +map de_dust2 +ip ipextern +port 27015 +maxplayers 32 +rcon_password BzbqF3v9 +sv_lan 0 & ??
Cum pot completa start si stop?
start = ./hlds_run -game cstrike +map de_dust2 +ip ipextern +port 27015 +maxplayers 32 +rcon_password BzbqF3v9 +sv_lan 0 & ??
Last edited by smileye on 17 Jan 2014, 20:41, edited 1 time in total.
-
- Membru, skill +2
- Posts: 550
- Joined: 31 Mar 2013, 15:18
- Detinator Steam: Da
- Has thanked: 35 times
- Been thanked: 21 times
Foloseste acest tutorial http://forum.fioriginal.ro/tutorial-ins ... -t770.html
Sau downloadeaza arhiva gata facuta. Iar cu "batchurile" pune un user pentru fiecare server, nu le tine ca root !
Sau downloadeaza arhiva gata facuta. Iar cu "batchurile" pune un user pentru fiecare server, nu le tine ca root !
Stay chill.
-
- Fost moderator
- Posts: 4648
- Joined: 12 Jun 2012, 15:18
- Detinator Steam: Da
- Reputatie: Fost moderator
- Has thanked: 258 times
- Been thanked: 38 times
- Contact:
Cu stopul nu ma descurc, ma chinui cu ps -x si sa vad pidurile ca sa le opresc.Cum pot pune un user pentru fiecare server ca nu is cunoscator.Trebuie sa instalez cand vreau sa fac tot alt server, sa reiau tutorialul si sa pun din nou batchul sa pornesc/opresc serverul?Clint wrote:Foloseste acest tutorial http://forum.fioriginal.ro/tutorial-ins ... -t770.html
Sau downloadeaza arhiva gata facuta. Iar cu "batchurile" pune un user pentru fiecare server, nu le tine ca root !
-
- Membru, skill +2
- Posts: 550
- Joined: 31 Mar 2013, 15:18
- Detinator Steam: Da
- Has thanked: 35 times
- Been thanked: 21 times
Code: Select all
adduser test
Pentru stop executat ca test shell.
kill -9 $(pgrep -u $USER -f hlds_run)
Last edited by Clint on 17 Jan 2014, 20:49, edited 1 time in total.
Stay chill.
-
- Fost moderator
- Posts: 4648
- Joined: 12 Jun 2012, 15:18
- Detinator Steam: Da
- Reputatie: Fost moderator
- Has thanked: 258 times
- Been thanked: 38 times
- Contact:
Cand se adauga userul, ininte de instalarea serverului?Clint wrote:Tinele in /home/$USERCode: Select all
adduser test
Nu exista tutoriale video pentru asta?Is obosit si nu prea imi dau seama cum ar veni.
-
- Membru, skill +2
- Posts: 550
- Joined: 31 Mar 2013, 15:18
- Detinator Steam: Da
- Has thanked: 35 times
- Been thanked: 21 times
Pai cand creezi un user o sa se faca un folder in /home cu numele acestuia, si aici pui fisierele de pe server... foloseste un server ftp (pure-ftpd sau proftpd) nu lucra ca root deoarece nu o sa mai ai acces ca user dupaceea si o sa trebuiasca sa ii dai iar permisiuni.
Stay chill.
-
- Fost moderator
- Posts: 4648
- Joined: 12 Jun 2012, 15:18
- Detinator Steam: Da
- Reputatie: Fost moderator
- Has thanked: 258 times
- Been thanked: 38 times
- Contact:
Pun fisierele care le am descarcate deja? ex. copiez folderul cu serverul hlds/cs/srv1 in acel user?Clint wrote:Pai cand creezi un user o sa se faca un folder in /home cu numele acestuia, si aici pui fisierele de pe server... foloseste un server ftp (pure-ftpd sau proftpd) nu lucra ca root deoarece nu o sa mai ai acces ca user dupaceea si o sa trebuiasca sa ii dai iar permisiuni.
-
- Membru, skill +2
- Posts: 550
- Joined: 31 Mar 2013, 15:18
- Detinator Steam: Da
- Has thanked: 35 times
- Been thanked: 21 times
Mda... dar asta inseamna ca trebuie sa-i spui fiecarui bash unde este localizat serverul, mai exact hlds_run (in caz ca le ai ceva de genu /home/user/hlds/hlds_run), dar poti sa uploadezi direct hlds in /home/user, si folosesti in bash comanda $HOME/./hlds_run +...
Stay chill.
-
- Fost moderator
- Posts: 4648
- Joined: 12 Jun 2012, 15:18
- Detinator Steam: Da
- Reputatie: Fost moderator
- Has thanked: 258 times
- Been thanked: 38 times
- Contact:
Asa fac si cei care gazduiesc sute de servere, firmele astea?Face la fiecare server cate un bash?Cu gamecp nu ar fi mai usor sa fac?Clint wrote:Mda... dar asta inseamna ca trebuie sa-i spui fiecarui bash unde este localizat serverul, mai exact hlds_run (in caz ca le ai ceva de genu /home/user/hlds/hlds_run), dar poti sa uploadezi direct hlds in /home/user, si folosesti in bash comanda $HOME/./hlds_run +...
-
- Membru, skill +2
- Posts: 550
- Joined: 31 Mar 2013, 15:18
- Detinator Steam: Da
- Has thanked: 35 times
- Been thanked: 21 times
Acum este treaba ta, tu ai cerut "Batchuri pornire, restart, stop".Daca vrei foloseste si GameCP, dar 1-nu este gratis,2-iti trebuie web-server si o baza de date, care consuma.smileye wrote:Asa fac si cei care gazduiesc sute de servere, firmele astea?Face la fiecare server cate un bash?Cu gamecp nu ar fi mai usor sa fac?Clint wrote:Mda... dar asta inseamna ca trebuie sa-i spui fiecarui bash unde este localizat serverul, mai exact hlds_run (in caz ca le ai ceva de genu /home/user/hlds/hlds_run), dar poti sa uploadezi direct hlds in /home/user, si folosesti in bash comanda $HOME/./hlds_run +...
P.S. : @ Asa fac si cei care gazduiesc sute de servere, firmele astea?Face la fiecare server cate un bash? :-?? Una e 100 de servere si alta e 4 - 5.
Stay chill.