Can't keep server online - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Can't keep server online (
/showthread.php?tid=334642)
Can't keep server online -
jcvag44800 - 15.04.2012
Hi guys.
I have a problem for keeping my samp server online.
This is the script:
startgtaserver.sh
Код:
#!/bin/bash
export GTA_PATH=/home/samp
cd $GTA_PATH
while [ true ]; do
cat {$GTA_PATH}/server_log.txt >> {$GTA_PATH}/full_server_log.txt
rm {$GTA_PATH}/server_log.txt
touch {$GTA_PATH}/server_log.txt
./samp03svr
done
gtaserver.sh
Код:
#!/bin/bash
server_start() {
screen /home/samp/startgtaserver.sh & # put in full path and name of startup script
}
server_stop() {
killall startgtaserver.sh # your startup script name
killall samp03svr # need to put in path to killall if its not in $PATH
}
server_restart() {
server_stop
sleep 1
server_start
}
case "$1" in
'start')
server_start
;;
'stop')
server_stop
;;
'restart')
server_restart
;;
*)
echo "usage $0 start|stop|restart"
esac
But when I type the command gtaserver, it tells me it is incorrect ...
I'm on debian 6
Re : Can't keep server online -
jcvag44800 - 15.04.2012
I have try to use screen:
Код:
root@vps022:/home/samp# ls -l
total 1920
-rwxr-xr-x 1 1001 1001 11104 Mar 20 11:54 announce
drwxr-xr-x 2 1001 1001 4096 Apr 15 13:15 filterscripts
drwxr-xr-x 2 1001 1001 4096 Apr 15 13:15 gamemodes
drwxr-xr-x 2 1001 1001 4096 Sep 5 2009 include
drwxr-xr-x 3 1001 1001 4096 Sep 29 2009 npcmodes
drwxr-xr-x 3 root root 4096 Apr 15 13:16 pawno
-rwxr-xr-x 1 1001 1001 599088 Apr 4 18:28 samp-npc
-rwxr-xr-x 1 1001 1001 1320548 Apr 4 18:27 samp03svr
drwxr-xr-x 5 1001 1001 4096 Apr 15 13:16 scriptfiles
-rw-r--r-- 1 1001 1001 370 Apr 15 13:17 server.cfg
root@vps022:/home/samp# ./samp03svr
bash: ./samp03svr: No such file or directory