01.01.2011, 17:19
Quote:
|
не думаю,на 0.3а и 0.2х всё было путем,запускал также..сейчас запускаю через ./samp03svr & именно из за непоняток
ЗЫ что через start.sh что через ./samp03svr & сервер ведёт себя одинаково |
Code:
#!/bin/sh
serverLog="server_log.txt"
bin="./samp03svr"
dat=`date`
cd /указываем/тут/папку/серва
while true; do
mv ./${serverLog} ./logs/${serverLog}.`date '+%m%d%y%H%M%S'`
echo "${dat} running sa-mp 0.3 server..." >> ${serverLog}
${bin} >> ${serverLog}
echo "${dat} sa-mp 0.3 server stoped, restarting..." >> ${serverLog}
sleep 3
done
Code:
#!/bin/bash
#chkconfig: 234 60 50
#description: SA-MP 0.3 Server
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
server_start() {
/путь/к/скрипту/samp03WatchingScript.sh & # put in full path and name of startup script
}
server_stop() {
killall samp03WatchingScript.sh # your startup script name
killall samp03svr # need to put in path to killall if its not in $PATH
# killall samp-npc # need to put in path to killall if its not in $PATH
}
server_restart() {
server_stop
sleep 1
server_start
}
# See how we were called.
case "$1" in
'start')
server_start
;;
'stop')
server_stop
;;
'restart')
server_restart
;;
*)
echo "usage $0 start|stop|restart"
exit 0
esac
exit 1


