Commit bc0b03ad authored by ultramage's avatar ultramage

eol-style for the startup scripts and batch files

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11104 54d463be-8e91-2dee-dedb-b68131a5f0ec
parent 1dbdda4a
#!/bin/sh
# athena starting script by rowla
# modified by shazeya@syafi.com (NL101541)
PATH=./:$PATH
L_SRV=login-server_sql
C_SRV=char-server_sql
M_SRV=map-server_sql
print_start() {
# more << EOF
echo "Athena Starting..."
echo " (c) 2003 Athena Project"
echo " modified by shazeya@syafi.com"
echo ""
#echo "Debug informations will appear,"
#echo "since this is a test release."
#echo ""
echo "checking..."
#EOF
}
#check_account() {
# if [ ! -f ./save/account.txt ]; then
# echo "0 s1 p1 - S 0" > save/account.txt
# echo "1 s2 p2 - S 0" >>save/account.txt
# echo "2 s3 p3 - S 0" >>save/account.txt
# echo "3 s4 p4 - S 0" >>save/account.txt
# echo "4 s5 p5 - S 0" >>save/account.txt
# fi
#}
check_files() {
for i in ${L_SRV} ${C_SRV} ${M_SRV}
do
if [ ! -f ./$i ]; then
echo "$i does not exist, or can't run."
echo "Stop. Check your compile."
exit 1;
fi
done
# more << EOF
echo "Check complete."
echo "Looks good, a nice Athena!"
#EOF
}
case $1 in
'start')
print_start
# check_account
check_files
exec ./${L_SRV}&
exec ./${C_SRV}&
exec ./${M_SRV}&
echo "Now Started Athena."
;;
'stop')
ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill -9
;;
'restart')
$0 stop
$0 start
;;
*)
echo "Usage: athena-start { start | stop | restart }"
;;
esac
#!/bin/sh
# athena starting script by rowla
# modified by shazeya@syafi.com (NL101541)
PATH=./:$PATH
L_SRV=login-server_sql
C_SRV=char-server_sql
M_SRV=map-server_sql
print_start() {
# more << EOF
echo "Athena Starting..."
echo " (c) 2003 Athena Project"
echo " modified by shazeya@syafi.com"
echo ""
#echo "Debug informations will appear,"
#echo "since this is a test release."
#echo ""
echo "checking..."
#EOF
}
#check_account() {
# if [ ! -f ./save/account.txt ]; then
# echo "0 s1 p1 - S 0" > save/account.txt
# echo "1 s2 p2 - S 0" >>save/account.txt
# echo "2 s3 p3 - S 0" >>save/account.txt
# echo "3 s4 p4 - S 0" >>save/account.txt
# echo "4 s5 p5 - S 0" >>save/account.txt
# fi
#}
check_files() {
for i in ${L_SRV} ${C_SRV} ${M_SRV}
do
if [ ! -f ./$i ]; then
echo "$i does not exist, or can't run."
echo "Stop. Check your compile."
exit 1;
fi
done
# more << EOF
echo "Check complete."
echo "Looks good, a nice Athena!"
#EOF
}
case $1 in
'start')
print_start
# check_account
check_files
exec ./${L_SRV}&
exec ./${C_SRV}&
exec ./${M_SRV}&
echo "Now Started Athena."
;;
'stop')
ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill -9
;;
'restart')
$0 stop
$0 start
;;
*)
echo "Usage: athena-start { start | stop | restart }"
;;
esac
#/bin/sh
#Hi my naem is Kirt and I liek anime
ulimit -Sc unlimited
while [ 3 ] ; do
if [ -f .stopserver3 ] ; then
echo server marked down >> servlog.txt
else
echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
./char-server
fi
sleep 5
done
#/bin/sh
#Hi my naem is Kirt and I liek anime
ulimit -Sc unlimited
while [ 3 ] ; do
if [ -f .stopserver3 ] ; then
echo server marked down >> servlog.txt
else
echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
./char-server
fi
sleep 5
done
@echo off
rem Writen by Jbain
:end
char-server_sql.exe
echo .
echo .
echo Char server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
PING -n 15 127.0.0.1 >nul
@echo off
rem Writen by Jbain
:end
char-server_sql.exe
echo .
echo .
echo Char server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
PING -n 15 127.0.0.1 >nul
goto end
\ No newline at end of file
@echo off
rem Writen by Jbain
:end
char-server.exe
echo .
echo .
echo Char server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
PING -n 15 127.0.0.1 >nul
@echo off
rem Writen by Jbain
:end
char-server.exe
echo .
echo .
echo Char server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
PING -n 15 127.0.0.1 >nul
goto end
\ No newline at end of file
This diff is collapsed.
#/bin/sh
#Hi my naem is Kirt and I liek anime
ulimit -Sc unlimited
while [ 2 ] ; do
if [ -f .stopserver2 ] ; then
echo server marked down >> servlog.txt
else
echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
./login-server
fi
sleep 5
done
#/bin/sh
#Hi my naem is Kirt and I liek anime
ulimit -Sc unlimited
while [ 2 ] ; do
if [ -f .stopserver2 ] ; then
echo server marked down >> servlog.txt
else
echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
./login-server
fi
sleep 5
done
@echo off
rem Writen by Jbain
:end
login-server_sql.exe
echo .
echo .
echo Login server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
PING -n 15 127.0.0.1 >nul
@echo off
rem Writen by Jbain
:end
login-server_sql.exe
echo .
echo .
echo Login server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
PING -n 15 127.0.0.1 >nul
goto end
\ No newline at end of file
@echo off
rem Writen by Jbain
:end
login-server.exe
echo .
echo .
echo Login server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
PING -n 15 127.0.0.1 >nul
@echo off
rem Writen by Jbain
:end
login-server.exe
echo .
echo .
echo Login server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
PING -n 15 127.0.0.1 >nul
goto end
\ No newline at end of file
#/bin/sh
#Hi my naem is Kirt and I liek anime
ulimit -Sc unlimited
while [ 1 ] ; do
if [ -f .stopserver ] ; then
echo server marked down >> servlog.txt
else
echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
./map-server
fi
sleep 5
done
#/bin/sh
#Hi my naem is Kirt and I liek anime
ulimit -Sc unlimited
while [ 1 ] ; do
if [ -f .stopserver ] ; then
echo server marked down >> servlog.txt
else
echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
./map-server
fi
sleep 5
done
@echo off
rem Writen by Jbain
:end
map-server_sql.exe
echo .
echo .
echo Map server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
PING -n 15 127.0.0.1 >nul
@echo off
rem Writen by Jbain
:end
map-server_sql.exe
echo .
echo .
echo Map server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
PING -n 15 127.0.0.1 >nul
goto end
\ No newline at end of file
@echo off
rem Writen by Jbain
:end
map-server.exe
echo .
echo .
echo Map server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
PING -n 15 127.0.0.1 >nul
@echo off
rem Writen by Jbain
:end
map-server.exe
echo .
echo .
echo Map server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
PING -n 15 127.0.0.1 >nul
goto end
\ No newline at end of file
@echo off
echo Y | del src\char\*.o
echo Y | del src\char\GNUmakefile
echo Y | del src\char_sql\*.o
echo Y | del src\char_sql\GNUmakefile
echo Y | del src\common\obj\*.o
echo Y | rmdir src\common\obj
echo Y | del src\common\GNUmakefile
echo Y | del src\ladmin\GNUmakefile
echo Y | del src\login\*.o
echo Y | del src\login\GNUmakefile
echo Y | del src\login_sql\*.o
echo Y | del src\login_sql\GNUmakefile
echo Y | del src\map\txtobj\*.o
echo Y | rmdir src\map\txtobj
echo Y | del src\map\sqlobj\*.o
echo Y | rmdir src\map\sqlobj
echo Y | del src\map\GNUmakefile
echo Y | del src\txt-converter\char\GNUmakefile
echo Y | del src\txt-converter\char\*.o
echo Y | del src\txt-converter\login\GNUmakefile
echo Y | del src\txt-converter\login\*.o
echo Y | del char-converter.exe
echo Y | del char-server.exe
echo Y | del char-server_sql.exe
echo Y | del ladmin.exe
echo Y | del login-converter.exe
echo Y | del login-server.exe
echo Y | del login-server_sql.exe
echo Y | del map-server.exe
echo Y | del map-server_sql.exe
\ No newline at end of file
@echo off
rem This is and auto-restart script for the eAthena Ragnarok Online Server Emulator.
rem It will also keep the map server OPEN after it crashes to that errors may be
rem more easily identified
rem Writen by Jbain
start cmd /k logserv-sql.bat
start cmd /k charserv-sql.bat
start cmd /k mapserv-sql.bat
@echo off
rem This is and auto-restart script for the eAthena Ragnarok Online Server Emulator.
rem It will also keep the map server OPEN after it crashes to that errors may be
rem more easily identified
rem Writen by Jbain
start cmd /k logserv-sql.bat
start cmd /k charserv-sql.bat
start cmd /k mapserv-sql.bat
@echo off
rem ----- Configuration -----
rem Defines the server type (txt or sql).
set SERVER_TYPE=txt
rem Defines how long to wait before restarting (in seconds).
set SLEEP_TIME=15
rem Defines whether to run all servers in one window (yes or no).
set SINGLE_WINDOW=no
rem ----- ------------- -----
:L_Init
set this=%0
if %SERVER_TYPE% == txt set suffix=
if %SERVER_TYPE% == sql set suffix=_sql
if %SINGLE_WINDOW% == yes set wndswitch=/B
:L_Main
set command=%1
if "%command%" == "" goto L_DefaultAction
if %command% == exec goto L_ExecServerExe
if %command% == start goto L_StartServerExe
if %command% == stop goto L_StopServerExe
if %command% == restart echo "TODO"
goto L_EOF
:L_DefaultAction
:L_StartServer
call %this% start login-server%suffix%.exe
call %this% start char-server%suffix%.exe
call %this% start map-server%suffix%.exe
goto L_EOF
:L_StopServer
call %this% stop login-server%suffix%.exe
call %this% stop char-server%suffix%.exe
call %this% stop map-server%suffix%.exe
goto L_EOF
:L_StartServerExe
set filename=%2
if "%filename%" == "" goto L_StartServer
if exist %filename% goto L_HaveExe
echo Cannot start '%filename%' because the file is missing!
goto L_EOF
:L_HaveExe
echo Starting %filename%...
start "%filename%" %wndswitch% %this% exec %filename%
goto L_EOF
:L_StopServerExe
set filename=%2
if "%filename%" == "" goto L_StopServer
if exist %windir%\system32\taskkill.exe goto L_HaveTaskKill
echo The 'stop' command is not available on your system.
exit
:L_HaveTaskKill
rem CAUTION! This will kill all processes called %filename%.
echo Stopping '%filename%'...
taskkill /F /FI "WINDOWTITLE eq %filename% - %this% exec %filename%"
taskkill /F /IM "%filename%"
goto L_EOF
:L_ExecServerExe
%filename%
echo .
echo .
echo Server exited, restarting in %SLEEP_TIME% seconds! Press CTRL+C to abort!
ping.exe -n %SLEEP_TIME% 127.0.0.1 > nul
goto L_ExecServerExe
:L_EOF
@echo off
rem ----- Configuration -----
rem Defines the server type (txt or sql).
set SERVER_TYPE=txt
rem Defines how long to wait before restarting (in seconds).
set SLEEP_TIME=15
rem Defines whether to run all servers in one window (yes or no).
set SINGLE_WINDOW=no
rem ----- ------------- -----
:L_Init
set this=%0
if %SERVER_TYPE% == txt set suffix=
if %SERVER_TYPE% == sql set suffix=_sql
if %SINGLE_WINDOW% == yes set wndswitch=/B
:L_Main
set command=%1
if "%command%" == "" goto L_DefaultAction
if %command% == exec goto L_ExecServerExe
if %command% == start goto L_StartServerExe
if %command% == stop goto L_StopServerExe
if %command% == restart echo "TODO"
goto L_EOF
:L_DefaultAction
:L_StartServer
call %this% start login-server%suffix%.exe
call %this% start char-server%suffix%.exe
call %this% start map-server%suffix%.exe
goto L_EOF
:L_StopServer
call %this% stop login-server%suffix%.exe
call %this% stop char-server%suffix%.exe
call %this% stop map-server%suffix%.exe
goto L_EOF
:L_StartServerExe
set filename=%2
if "%filename%" == "" goto L_StartServer
if exist %filename% goto L_HaveExe
echo Cannot start '%filename%' because the file is missing!
goto L_EOF
:L_HaveExe
echo Starting %filename%...
start "%filename%" %wndswitch% %this% exec %filename%
goto L_EOF
:L_StopServerExe
set filename=%2
if "%filename%" == "" goto L_StopServer
if exist %windir%\system32\taskkill.exe goto L_HaveTaskKill
echo The 'stop' command is not available on your system.
exit
:L_HaveTaskKill
rem CAUTION! This will kill all processes called %filename%.
echo Stopping '%filename%'...
taskkill /F /FI "WINDOWTITLE eq %filename% - %this% exec %filename%"
taskkill /F /IM "%filename%"
goto L_EOF
:L_ExecServerExe
%filename%
echo .
echo .
echo Server exited, restarting in %SLEEP_TIME% seconds! Press CTRL+C to abort!
ping.exe -n %SLEEP_TIME% 127.0.0.1 > nul
goto L_ExecServerExe
:L_EOF
#!/bin/bash
# modified by shazeya@syafi.com (NL130240)
./athena-start start
sleep 30
while [ true ]; do
if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
[ " 0" = "$(ps | grep -e char | wc -l)" ] ||
[ " 0" = "$(ps | grep -e map | wc -l)" ]; then
printf "Error:"
date
sleep 10
printf "Checking:"
date
if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
[ " 0" = "$(ps | grep -e char | wc -l)" ] ||
[ " 0" = "$(ps | grep -e map | wc -l)" ]; then
printf "Error Confirmation:"
date
printf "Restoration:"
date
./athena-start start
else
printf "Check Miss Sorry:"
date
fi
# else
# printf "Check OK:"
# date
fi
sleep 10
done
#!/bin/bash
# modified by shazeya@syafi.com (NL130240)
./athena-start start
sleep 30
while [ true ]; do
if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
[ " 0" = "$(ps | grep -e char | wc -l)" ] ||
[ " 0" = "$(ps | grep -e map | wc -l)" ]; then
printf "Error:"
date
sleep 10
printf "Checking:"
date
if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
[ " 0" = "$(ps | grep -e char | wc -l)" ] ||
[ " 0" = "$(ps | grep -e map | wc -l)" ]; then
printf "Error Confirmation:"
date
printf "Restoration:"
date
./athena-start start
else
printf "Check Miss Sorry:"
date
fi
# else
# printf "Check OK:"
# date
fi
sleep 10
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment