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
This commit is contained in:
parent
1dbdda4a4b
commit
bc0b03adc2
148
athena-start
148
athena-start
@ -1,74 +1,74 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# athena starting script by rowla
|
# athena starting script by rowla
|
||||||
# modified by shazeya@syafi.com (NL101541)
|
# modified by shazeya@syafi.com (NL101541)
|
||||||
|
|
||||||
PATH=./:$PATH
|
PATH=./:$PATH
|
||||||
|
|
||||||
L_SRV=login-server_sql
|
L_SRV=login-server_sql
|
||||||
C_SRV=char-server_sql
|
C_SRV=char-server_sql
|
||||||
M_SRV=map-server_sql
|
M_SRV=map-server_sql
|
||||||
|
|
||||||
print_start() {
|
print_start() {
|
||||||
# more << EOF
|
# more << EOF
|
||||||
echo "Athena Starting..."
|
echo "Athena Starting..."
|
||||||
echo " (c) 2003 Athena Project"
|
echo " (c) 2003 Athena Project"
|
||||||
echo " modified by shazeya@syafi.com"
|
echo " modified by shazeya@syafi.com"
|
||||||
echo ""
|
echo ""
|
||||||
#echo "Debug informations will appear,"
|
#echo "Debug informations will appear,"
|
||||||
#echo "since this is a test release."
|
#echo "since this is a test release."
|
||||||
#echo ""
|
#echo ""
|
||||||
echo "checking..."
|
echo "checking..."
|
||||||
#EOF
|
#EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
#check_account() {
|
#check_account() {
|
||||||
# if [ ! -f ./save/account.txt ]; then
|
# if [ ! -f ./save/account.txt ]; then
|
||||||
# echo "0 s1 p1 - S 0" > save/account.txt
|
# echo "0 s1 p1 - S 0" > save/account.txt
|
||||||
# echo "1 s2 p2 - S 0" >>save/account.txt
|
# echo "1 s2 p2 - S 0" >>save/account.txt
|
||||||
# echo "2 s3 p3 - S 0" >>save/account.txt
|
# echo "2 s3 p3 - S 0" >>save/account.txt
|
||||||
# echo "3 s4 p4 - S 0" >>save/account.txt
|
# echo "3 s4 p4 - S 0" >>save/account.txt
|
||||||
# echo "4 s5 p5 - S 0" >>save/account.txt
|
# echo "4 s5 p5 - S 0" >>save/account.txt
|
||||||
# fi
|
# fi
|
||||||
#}
|
#}
|
||||||
|
|
||||||
check_files() {
|
check_files() {
|
||||||
|
|
||||||
for i in ${L_SRV} ${C_SRV} ${M_SRV}
|
for i in ${L_SRV} ${C_SRV} ${M_SRV}
|
||||||
do
|
do
|
||||||
if [ ! -f ./$i ]; then
|
if [ ! -f ./$i ]; then
|
||||||
echo "$i does not exist, or can't run."
|
echo "$i does not exist, or can't run."
|
||||||
echo "Stop. Check your compile."
|
echo "Stop. Check your compile."
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# more << EOF
|
# more << EOF
|
||||||
echo "Check complete."
|
echo "Check complete."
|
||||||
echo "Looks good, a nice Athena!"
|
echo "Looks good, a nice Athena!"
|
||||||
#EOF
|
#EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
'start')
|
'start')
|
||||||
print_start
|
print_start
|
||||||
# check_account
|
# check_account
|
||||||
check_files
|
check_files
|
||||||
|
|
||||||
exec ./${L_SRV}&
|
exec ./${L_SRV}&
|
||||||
exec ./${C_SRV}&
|
exec ./${C_SRV}&
|
||||||
exec ./${M_SRV}&
|
exec ./${M_SRV}&
|
||||||
|
|
||||||
echo "Now Started Athena."
|
echo "Now Started Athena."
|
||||||
;;
|
;;
|
||||||
'stop')
|
'stop')
|
||||||
ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill -9
|
ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill -9
|
||||||
;;
|
;;
|
||||||
'restart')
|
'restart')
|
||||||
$0 stop
|
$0 stop
|
||||||
$0 start
|
$0 start
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: athena-start { start | stop | restart }"
|
echo "Usage: athena-start { start | stop | restart }"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
#/bin/sh
|
#/bin/sh
|
||||||
#Hi my naem is Kirt and I liek anime
|
#Hi my naem is Kirt and I liek anime
|
||||||
|
|
||||||
ulimit -Sc unlimited
|
ulimit -Sc unlimited
|
||||||
|
|
||||||
while [ 3 ] ; do
|
while [ 3 ] ; do
|
||||||
if [ -f .stopserver3 ] ; then
|
if [ -f .stopserver3 ] ; then
|
||||||
echo server marked down >> servlog.txt
|
echo server marked down >> servlog.txt
|
||||||
else
|
else
|
||||||
echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
|
echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
|
||||||
./char-server
|
./char-server
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
done
|
done
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
@echo off
|
@echo off
|
||||||
rem Writen by Jbain
|
rem Writen by Jbain
|
||||||
:end
|
:end
|
||||||
char-server_sql.exe
|
char-server_sql.exe
|
||||||
echo .
|
echo .
|
||||||
echo .
|
echo .
|
||||||
echo Char server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
|
echo Char server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
|
||||||
PING -n 15 127.0.0.1 >nul
|
PING -n 15 127.0.0.1 >nul
|
||||||
goto end
|
goto end
|
16
charserv.bat
16
charserv.bat
@ -1,9 +1,9 @@
|
|||||||
@echo off
|
@echo off
|
||||||
rem Writen by Jbain
|
rem Writen by Jbain
|
||||||
:end
|
:end
|
||||||
char-server.exe
|
char-server.exe
|
||||||
echo .
|
echo .
|
||||||
echo .
|
echo .
|
||||||
echo Char server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
|
echo Char server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
|
||||||
PING -n 15 127.0.0.1 >nul
|
PING -n 15 127.0.0.1 >nul
|
||||||
goto end
|
goto end
|
512
configure
vendored
512
configure
vendored
@ -1,256 +1,256 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
## NOTE:
|
## NOTE:
|
||||||
## I know this is not a clean way to check for some stuff
|
## I know this is not a clean way to check for some stuff
|
||||||
## and edit the Makefile, but hey, it does work!
|
## and edit the Makefile, but hey, it does work!
|
||||||
|
|
||||||
# Configure script for eAthena
|
# Configure script for eAthena
|
||||||
# Copyright (C) 2005 dontBR
|
# Copyright (C) 2005 dontBR
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
|
||||||
# Default variables
|
# Default variables
|
||||||
status_mmx="No"
|
status_mmx="No"
|
||||||
status_sse="No"
|
status_sse="No"
|
||||||
status_sse2="No"
|
status_sse2="No"
|
||||||
status_sse3="No"
|
status_sse3="No"
|
||||||
status_pcre="No"
|
status_pcre="No"
|
||||||
prefix='/opt/eathena/'
|
prefix='/opt/eathena/'
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
function check_sed {
|
function check_sed {
|
||||||
echo -n "Checking for sed... "
|
echo -n "Checking for sed... "
|
||||||
if [ -f $(which sed) ]; then
|
if [ -f $(which sed) ]; then
|
||||||
echo "yes"
|
echo "yes"
|
||||||
else
|
else
|
||||||
echo "Error: sed not found in $PATH"
|
echo "Error: sed not found in $PATH"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_gcc {
|
function check_gcc {
|
||||||
echo -n "Checking for gcc... "
|
echo -n "Checking for gcc... "
|
||||||
if [ -f $(which gcc) ]; then
|
if [ -f $(which gcc) ]; then
|
||||||
echo "yes"
|
echo "yes"
|
||||||
else
|
else
|
||||||
echo "Error: GCC not found in $PATH"
|
echo "Error: GCC not found in $PATH"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_make {
|
function check_make {
|
||||||
echo -n "Checking for (g)make... "
|
echo -n "Checking for (g)make... "
|
||||||
if [ -f $(which make) ]; then
|
if [ -f $(which make) ]; then
|
||||||
maker=make
|
maker=make
|
||||||
echo "yes"
|
echo "yes"
|
||||||
else if [ -f $(which gmake) ]; then
|
else if [ -f $(which gmake) ]; then
|
||||||
maker=gmake
|
maker=gmake
|
||||||
echo "yes"
|
echo "yes"
|
||||||
else
|
else
|
||||||
echo "Error: (g)make not found in $PATH"
|
echo "Error: (g)make not found in $PATH"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_sockets {
|
function check_sockets {
|
||||||
echo -n "Checking for sockets... "
|
echo -n "Checking for sockets... "
|
||||||
echo "#include <sys/types.h>
|
echo "#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
int main(){
|
int main(){
|
||||||
}" > test_sockets.c
|
}" > test_sockets.c
|
||||||
if $(gcc test_sockets.c -o test_sockets); then
|
if $(gcc test_sockets.c -o test_sockets); then
|
||||||
echo "yes"
|
echo "yes"
|
||||||
rm -f test_sockets.c test_sockets
|
rm -f test_sockets.c test_sockets
|
||||||
else
|
else
|
||||||
echo "Error: Unix sockets not found/working."
|
echo "Error: Unix sockets not found/working."
|
||||||
exit 1
|
exit 1
|
||||||
rm -f test_sockets.c
|
rm -f test_sockets.c
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_mysql_headers {
|
function check_mysql_headers {
|
||||||
echo -n "Checking for MySQL headers... "
|
echo -n "Checking for MySQL headers... "
|
||||||
if [ -d /usr/local/lib/mysql ]; then # Default
|
if [ -d /usr/local/lib/mysql ]; then # Default
|
||||||
echo "yes"
|
echo "yes"
|
||||||
mysql_headers_path='/usr/local/lib/mysql'
|
mysql_headers_path='/usr/local/lib/mysql'
|
||||||
else
|
else
|
||||||
if [ -d /usr/include/mysql ]; then # Gentoo/Debian/?
|
if [ -d /usr/include/mysql ]; then # Gentoo/Debian/?
|
||||||
echo "yes"
|
echo "yes"
|
||||||
mysql_headers_path='/usr/include/mysql'
|
mysql_headers_path='/usr/include/mysql'
|
||||||
else
|
else
|
||||||
echo "Error: MySQL headers not found."
|
echo "Error: MySQL headers not found."
|
||||||
mysql_headers_path='Not found.'
|
mysql_headers_path='Not found.'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function optimize {
|
function optimize {
|
||||||
case $@ in
|
case $@ in
|
||||||
mmx ) status_mmx="Yes" ;;
|
mmx ) status_mmx="Yes" ;;
|
||||||
sse ) status_sse="Yes" ;;
|
sse ) status_sse="Yes" ;;
|
||||||
sse2 ) status_sse2="Yes" ;;
|
sse2 ) status_sse2="Yes" ;;
|
||||||
sse3 ) status_sse3="Yes" ;;
|
sse3 ) status_sse3="Yes" ;;
|
||||||
all ) status_mmx="Yes"
|
all ) status_mmx="Yes"
|
||||||
status_sse="Yes"
|
status_sse="Yes"
|
||||||
status_sse2="Yes"
|
status_sse2="Yes"
|
||||||
status_sse3="Yes" ;;
|
status_sse3="Yes" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function make_changes {
|
function make_changes {
|
||||||
if [ "$maker" != "make" ]; then
|
if [ "$maker" != "make" ]; then
|
||||||
sed -e 's,MAKE = make,MAKE = '$maker',g' Makefile -i
|
sed -e 's,MAKE = make,MAKE = '$maker',g' Makefile -i
|
||||||
fi
|
fi
|
||||||
if [ "$status_mmx" = "Yes" ]; then
|
if [ "$status_mmx" = "Yes" ]; then
|
||||||
sed -e 's,# OPT += -mmmx,OPT += -mmmx,g' Makefile -i
|
sed -e 's,# OPT += -mmmx,OPT += -mmmx,g' Makefile -i
|
||||||
fi
|
fi
|
||||||
if [ "$status_sse" = "Yes" ]; then
|
if [ "$status_sse" = "Yes" ]; then
|
||||||
sed -e 's,# OPT += -msse,OPT += -msse,g' Makefile -i
|
sed -e 's,# OPT += -msse,OPT += -msse,g' Makefile -i
|
||||||
fi
|
fi
|
||||||
if [ "$status_sse2" = "Yes" ]; then
|
if [ "$status_sse2" = "Yes" ]; then
|
||||||
sed -e 's,# OPT += -msse2,OPT += -msse2,g' Makefile -i
|
sed -e 's,# OPT += -msse2,OPT += -msse2,g' Makefile -i
|
||||||
fi
|
fi
|
||||||
if [ "$status_sse3" = "Yes" ]; then
|
if [ "$status_sse3" = "Yes" ]; then
|
||||||
sed -e 's,# OPT += -msse3,OPT += -msse3,g' Makefile -i
|
sed -e 's,# OPT += -msse3,OPT += -msse3,g' Makefile -i
|
||||||
fi
|
fi
|
||||||
if [ "$status_pcre" = "Yes" ]; then
|
if [ "$status_pcre" = "Yes" ]; then
|
||||||
sed -e 's,# OPT += -DPCRE_SUPPORT,OPT += -DPCRE_SUPPORT,g' Makefile -i
|
sed -e 's,# OPT += -DPCRE_SUPPORT,OPT += -DPCRE_SUPPORT,g' Makefile -i
|
||||||
fi
|
fi
|
||||||
if [ "$mysql_headers_path" != "/usr/local/lib/mysql" ] && [ "$mysql_headers_path" != "Not found." ]; then
|
if [ "$mysql_headers_path" != "/usr/local/lib/mysql" ] && [ "$mysql_headers_path" != "Not found." ]; then
|
||||||
sed -e 's,LIBS += -L/usr/local/lib/mysql -lmysqlclient,LIBS += -L'$mysql_headers_path' -lmysqlclient,g' Makefile -i
|
sed -e 's,LIBS += -L/usr/local/lib/mysql -lmysqlclient,LIBS += -L'$mysql_headers_path' -lmysqlclient,g' Makefile -i
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function opt_check_pcre {
|
function opt_check_pcre {
|
||||||
echo -n "Checking for PCRE... "
|
echo -n "Checking for PCRE... "
|
||||||
if [ -f /usr/local/lib/pcre.h ]; then
|
if [ -f /usr/local/lib/pcre.h ]; then
|
||||||
echo "yes"
|
echo "yes"
|
||||||
status_pcre="Yes"
|
status_pcre="Yes"
|
||||||
else
|
else
|
||||||
echo "Error: PCRE not found."
|
echo "Error: PCRE not found."
|
||||||
status_pcre="No"
|
status_pcre="No"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function make_report {
|
function make_report {
|
||||||
echo "Configuration report:"
|
echo "Configuration report:"
|
||||||
echo eAthena
|
echo eAthena
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo Enable PCRE support..... : $status_pcre
|
echo Enable PCRE support..... : $status_pcre
|
||||||
echo
|
echo
|
||||||
echo Enable MMX optimization. : $status_mmx
|
echo Enable MMX optimization. : $status_mmx
|
||||||
echo Enable SSE optimization. : $status_sse
|
echo Enable SSE optimization. : $status_sse
|
||||||
echo Enable SSE2 optimization : $status_sse2
|
echo Enable SSE2 optimization : $status_sse2
|
||||||
echo Enable SSE3 optimization : $status_sse3
|
echo Enable SSE3 optimization : $status_sse3
|
||||||
echo
|
echo
|
||||||
echo MySQL headers path...... : $mysql_headers_path
|
echo MySQL headers path...... : $mysql_headers_path
|
||||||
echo
|
echo
|
||||||
echo eAthena will be installed in $prefix
|
echo eAthena will be installed in $prefix
|
||||||
echo Please type \'make txt\' or \'make sql\' now to compile eAthena.
|
echo Please type \'make txt\' or \'make sql\' now to compile eAthena.
|
||||||
}
|
}
|
||||||
|
|
||||||
function helptext {
|
function helptext {
|
||||||
echo "eAthena Configure Script version 0.1"
|
echo "eAthena Configure Script version 0.1"
|
||||||
echo
|
echo
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo
|
echo
|
||||||
echo " -h Display this help message and exit."
|
echo " -h Display this help message and exit."
|
||||||
echo " -d Enter debug mode."
|
echo " -d Enter debug mode."
|
||||||
echo " -o Turn on optimization flags."
|
echo " -o Turn on optimization flags."
|
||||||
echo " Supported:"
|
echo " Supported:"
|
||||||
echo " mmx"
|
echo " mmx"
|
||||||
echo " sse"
|
echo " sse"
|
||||||
echo " sse2"
|
echo " sse2"
|
||||||
echo " sse3"
|
echo " sse3"
|
||||||
echo " all"
|
echo " all"
|
||||||
echo " -e Enable PCRE support."
|
echo " -e Enable PCRE support."
|
||||||
echo " -p Root directory where eA is going to be installed."
|
echo " -p Root directory where eA is going to be installed."
|
||||||
echo " DON'T FORGET THE LAST SLASH!"
|
echo " DON'T FORGET THE LAST SLASH!"
|
||||||
echo " For example:"
|
echo " For example:"
|
||||||
echo " ./configure -p /usr/local/"
|
echo " ./configure -p /usr/local/"
|
||||||
echo " This will create /usr/local/bin/login-server,"
|
echo " This will create /usr/local/bin/login-server,"
|
||||||
echo " /usr/local/etc/eathena/save/account.txt, etc"
|
echo " /usr/local/etc/eathena/save/account.txt, etc"
|
||||||
echo " Default is /opt/eathena/"
|
echo " Default is /opt/eathena/"
|
||||||
echo
|
echo
|
||||||
echo "Report bugs (about the configure script) to dontBR at the eAthena Support Board."
|
echo "Report bugs (about the configure script) to dontBR at the eAthena Support Board."
|
||||||
}
|
}
|
||||||
|
|
||||||
function make_installable {
|
function make_installable {
|
||||||
echo -e '' >> Makefile
|
echo -e '' >> Makefile
|
||||||
echo -e 'install: conf/%.conf conf/%.txt' >> Makefile
|
echo -e 'install: conf/%.conf conf/%.txt' >> Makefile
|
||||||
echo -e ' $(shell mkdir -p '$prefix'bin/)' >> Makefile
|
echo -e ' $(shell mkdir -p '$prefix'bin/)' >> Makefile
|
||||||
echo -e ' $(shell mkdir -p '$prefix'etc/eathena/)' >> Makefile
|
echo -e ' $(shell mkdir -p '$prefix'etc/eathena/)' >> Makefile
|
||||||
echo -e ' $(shell mkdir -p '$prefix'var/log/eathena/)' >> Makefile
|
echo -e ' $(shell mkdir -p '$prefix'var/log/eathena/)' >> Makefile
|
||||||
echo -e ' $(shell mv save '$prefix'etc/eathena/save)' >> Makefile
|
echo -e ' $(shell mv save '$prefix'etc/eathena/save)' >> Makefile
|
||||||
echo -e ' $(shell mv db '$prefix'etc/eathena/db)' >> Makefile
|
echo -e ' $(shell mv db '$prefix'etc/eathena/db)' >> Makefile
|
||||||
echo -e ' $(shell mv conf '$prefix'etc/eathena/conf)' >> Makefile
|
echo -e ' $(shell mv conf '$prefix'etc/eathena/conf)' >> Makefile
|
||||||
echo -e ' $(shell mv npc '$prefix'etc/eathena/npc)' >> Makefile
|
echo -e ' $(shell mv npc '$prefix'etc/eathena/npc)' >> Makefile
|
||||||
echo -e ' $(shell mv log/* '$prefix'var/log/eathena/)' >> Makefile
|
echo -e ' $(shell mv log/* '$prefix'var/log/eathena/)' >> Makefile
|
||||||
echo -e ' $(shell cp *-server* '$prefix'bin/)' >> Makefile
|
echo -e ' $(shell cp *-server* '$prefix'bin/)' >> Makefile
|
||||||
echo -e ' $(shell cp ladmin '$prefix'bin/)' >> Makefile
|
echo -e ' $(shell cp ladmin '$prefix'bin/)' >> Makefile
|
||||||
echo -e ' $(shell ln -s '$prefix'etc/eathena/save/ '$prefix'bin/)' >> Makefile
|
echo -e ' $(shell ln -s '$prefix'etc/eathena/save/ '$prefix'bin/)' >> Makefile
|
||||||
echo -e ' $(shell ln -s '$prefix'etc/eathena/db/ '$prefix'bin/)' >> Makefile
|
echo -e ' $(shell ln -s '$prefix'etc/eathena/db/ '$prefix'bin/)' >> Makefile
|
||||||
echo -e ' $(shell ln -s '$prefix'etc/eathena/conf/ '$prefix'bin/)' >> Makefile
|
echo -e ' $(shell ln -s '$prefix'etc/eathena/conf/ '$prefix'bin/)' >> Makefile
|
||||||
echo -e ' $(shell ln -s '$prefix'etc/eathena/npc/ '$prefix'bin/)' >> Makefile
|
echo -e ' $(shell ln -s '$prefix'etc/eathena/npc/ '$prefix'bin/)' >> Makefile
|
||||||
echo -e ' $(shell ln -s '$prefix'var/log/eathena/ '$prefix'bin/log)' >> Makefile
|
echo -e ' $(shell ln -s '$prefix'var/log/eathena/ '$prefix'bin/log)' >> Makefile
|
||||||
echo '' >> Makefile
|
echo '' >> Makefile
|
||||||
echo -e 'bin-clean:' >> Makefile
|
echo -e 'bin-clean:' >> Makefile
|
||||||
echo -e ' $(shell rm '$prefix'bin/login-server*)' >> Makefile
|
echo -e ' $(shell rm '$prefix'bin/login-server*)' >> Makefile
|
||||||
echo -e ' $(shell rm '$prefix'bin/char-server*)' >> Makefile
|
echo -e ' $(shell rm '$prefix'bin/char-server*)' >> Makefile
|
||||||
echo -e ' $(shell rm '$prefix'bin/map-server*)' >> Makefile
|
echo -e ' $(shell rm '$prefix'bin/map-server*)' >> Makefile
|
||||||
echo -e ' $(shell rm '$prefix'bin/ladmin)' >> Makefile
|
echo -e ' $(shell rm '$prefix'bin/ladmin)' >> Makefile
|
||||||
echo '' >> Makefile
|
echo '' >> Makefile
|
||||||
echo -e 'uninstall:' >> Makefile
|
echo -e 'uninstall:' >> Makefile
|
||||||
echo -e ' bin-clean' >> Makefile
|
echo -e ' bin-clean' >> Makefile
|
||||||
echo -e ' $(shell rm '$prefix'bin/save)' >> Makefile
|
echo -e ' $(shell rm '$prefix'bin/save)' >> Makefile
|
||||||
echo -e ' $(shell rm '$prefix'bin/db)' >> Makefile
|
echo -e ' $(shell rm '$prefix'bin/db)' >> Makefile
|
||||||
echo -e ' $(shell rm '$prefix'bin/conf)' >> Makefile
|
echo -e ' $(shell rm '$prefix'bin/conf)' >> Makefile
|
||||||
echo -e ' $(shell rm '$prefix'bin/npc)' >> Makefile
|
echo -e ' $(shell rm '$prefix'bin/npc)' >> Makefile
|
||||||
echo -e ' $(shell rm '$prefix'bin/log)' >> Makefile
|
echo -e ' $(shell rm '$prefix'bin/log)' >> Makefile
|
||||||
echo -e ' $(shell rm -rf '$prefix'etc/eathena)' >> Makefile
|
echo -e ' $(shell rm -rf '$prefix'etc/eathena)' >> Makefile
|
||||||
echo -e ' $(shell rm -rf '$prefix'var/log/eathena)' >> Makefile
|
echo -e ' $(shell rm -rf '$prefix'var/log/eathena)' >> Makefile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Arguments
|
# Arguments
|
||||||
while getopts ":hdo:ep:" opt; do
|
while getopts ":hdo:ep:" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
h ) helptext ; exit ;;
|
h ) helptext ; exit ;;
|
||||||
d ) set -x ;;
|
d ) set -x ;;
|
||||||
o ) optimize ${OPTARG} ;;
|
o ) optimize ${OPTARG} ;;
|
||||||
e ) opt_check_pcre ;;
|
e ) opt_check_pcre ;;
|
||||||
p ) prefix=${OPTARG} ; [ -d ${OPTARG} ] || echo "The directory $prefix does not exist. Creating...";;
|
p ) prefix=${OPTARG} ; [ -d ${OPTARG} ] || echo "The directory $prefix does not exist. Creating...";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
# Execution
|
# Execution
|
||||||
echo "eAthena configure script"
|
echo "eAthena configure script"
|
||||||
echo "Note: This is ALPHA software! Do NOT use it on a production server!"
|
echo "Note: This is ALPHA software! Do NOT use it on a production server!"
|
||||||
echo
|
echo
|
||||||
echo "Checking for dependencies.."
|
echo "Checking for dependencies.."
|
||||||
check_sed
|
check_sed
|
||||||
check_gcc
|
check_gcc
|
||||||
check_make
|
check_make
|
||||||
check_sockets
|
check_sockets
|
||||||
check_mysql_headers
|
check_mysql_headers
|
||||||
make_changes
|
make_changes
|
||||||
make_installable
|
make_installable
|
||||||
echo
|
echo
|
||||||
make_report
|
make_report
|
||||||
exit
|
exit
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
#/bin/sh
|
#/bin/sh
|
||||||
#Hi my naem is Kirt and I liek anime
|
#Hi my naem is Kirt and I liek anime
|
||||||
|
|
||||||
ulimit -Sc unlimited
|
ulimit -Sc unlimited
|
||||||
|
|
||||||
while [ 2 ] ; do
|
while [ 2 ] ; do
|
||||||
if [ -f .stopserver2 ] ; then
|
if [ -f .stopserver2 ] ; then
|
||||||
echo server marked down >> servlog.txt
|
echo server marked down >> servlog.txt
|
||||||
else
|
else
|
||||||
echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
|
echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
|
||||||
./login-server
|
./login-server
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
done
|
done
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
@echo off
|
@echo off
|
||||||
rem Writen by Jbain
|
rem Writen by Jbain
|
||||||
:end
|
:end
|
||||||
login-server_sql.exe
|
login-server_sql.exe
|
||||||
echo .
|
echo .
|
||||||
echo .
|
echo .
|
||||||
echo Login server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
|
echo Login server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
|
||||||
PING -n 15 127.0.0.1 >nul
|
PING -n 15 127.0.0.1 >nul
|
||||||
goto end
|
goto end
|
16
logserv.bat
16
logserv.bat
@ -1,9 +1,9 @@
|
|||||||
@echo off
|
@echo off
|
||||||
rem Writen by Jbain
|
rem Writen by Jbain
|
||||||
:end
|
:end
|
||||||
login-server.exe
|
login-server.exe
|
||||||
echo .
|
echo .
|
||||||
echo .
|
echo .
|
||||||
echo Login server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
|
echo Login server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
|
||||||
PING -n 15 127.0.0.1 >nul
|
PING -n 15 127.0.0.1 >nul
|
||||||
goto end
|
goto end
|
@ -1,16 +1,16 @@
|
|||||||
#/bin/sh
|
#/bin/sh
|
||||||
#Hi my naem is Kirt and I liek anime
|
#Hi my naem is Kirt and I liek anime
|
||||||
|
|
||||||
ulimit -Sc unlimited
|
ulimit -Sc unlimited
|
||||||
|
|
||||||
while [ 1 ] ; do
|
while [ 1 ] ; do
|
||||||
if [ -f .stopserver ] ; then
|
if [ -f .stopserver ] ; then
|
||||||
echo server marked down >> servlog.txt
|
echo server marked down >> servlog.txt
|
||||||
else
|
else
|
||||||
echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
|
echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
|
||||||
./map-server
|
./map-server
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
done
|
done
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
@echo off
|
@echo off
|
||||||
rem Writen by Jbain
|
rem Writen by Jbain
|
||||||
:end
|
:end
|
||||||
map-server_sql.exe
|
map-server_sql.exe
|
||||||
echo .
|
echo .
|
||||||
echo .
|
echo .
|
||||||
echo Map server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
|
echo Map server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
|
||||||
PING -n 15 127.0.0.1 >nul
|
PING -n 15 127.0.0.1 >nul
|
||||||
goto end
|
goto end
|
16
mapserv.bat
16
mapserv.bat
@ -1,9 +1,9 @@
|
|||||||
@echo off
|
@echo off
|
||||||
rem Writen by Jbain
|
rem Writen by Jbain
|
||||||
:end
|
:end
|
||||||
map-server.exe
|
map-server.exe
|
||||||
echo .
|
echo .
|
||||||
echo .
|
echo .
|
||||||
echo Map server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
|
echo Map server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
|
||||||
PING -n 15 127.0.0.1 >nul
|
PING -n 15 127.0.0.1 >nul
|
||||||
goto end
|
goto end
|
@ -1,31 +0,0 @@
|
|||||||
@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
|
|
@ -1,8 +1,8 @@
|
|||||||
@echo off
|
@echo off
|
||||||
rem This is and auto-restart script for the eAthena Ragnarok Online Server Emulator.
|
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 It will also keep the map server OPEN after it crashes to that errors may be
|
||||||
rem more easily identified
|
rem more easily identified
|
||||||
rem Writen by Jbain
|
rem Writen by Jbain
|
||||||
start cmd /k logserv-sql.bat
|
start cmd /k logserv-sql.bat
|
||||||
start cmd /k charserv-sql.bat
|
start cmd /k charserv-sql.bat
|
||||||
start cmd /k mapserv-sql.bat
|
start cmd /k mapserv-sql.bat
|
||||||
|
150
runserver.bat
150
runserver.bat
@ -1,75 +1,75 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
rem ----- Configuration -----
|
rem ----- Configuration -----
|
||||||
rem Defines the server type (txt or sql).
|
rem Defines the server type (txt or sql).
|
||||||
set SERVER_TYPE=txt
|
set SERVER_TYPE=txt
|
||||||
rem Defines how long to wait before restarting (in seconds).
|
rem Defines how long to wait before restarting (in seconds).
|
||||||
set SLEEP_TIME=15
|
set SLEEP_TIME=15
|
||||||
rem Defines whether to run all servers in one window (yes or no).
|
rem Defines whether to run all servers in one window (yes or no).
|
||||||
set SINGLE_WINDOW=no
|
set SINGLE_WINDOW=no
|
||||||
rem ----- ------------- -----
|
rem ----- ------------- -----
|
||||||
|
|
||||||
:L_Init
|
:L_Init
|
||||||
set this=%0
|
set this=%0
|
||||||
if %SERVER_TYPE% == txt set suffix=
|
if %SERVER_TYPE% == txt set suffix=
|
||||||
if %SERVER_TYPE% == sql set suffix=_sql
|
if %SERVER_TYPE% == sql set suffix=_sql
|
||||||
if %SINGLE_WINDOW% == yes set wndswitch=/B
|
if %SINGLE_WINDOW% == yes set wndswitch=/B
|
||||||
|
|
||||||
:L_Main
|
:L_Main
|
||||||
set command=%1
|
set command=%1
|
||||||
if "%command%" == "" goto L_DefaultAction
|
if "%command%" == "" goto L_DefaultAction
|
||||||
|
|
||||||
if %command% == exec goto L_ExecServerExe
|
if %command% == exec goto L_ExecServerExe
|
||||||
if %command% == start goto L_StartServerExe
|
if %command% == start goto L_StartServerExe
|
||||||
if %command% == stop goto L_StopServerExe
|
if %command% == stop goto L_StopServerExe
|
||||||
if %command% == restart echo "TODO"
|
if %command% == restart echo "TODO"
|
||||||
goto L_EOF
|
goto L_EOF
|
||||||
|
|
||||||
:L_DefaultAction
|
:L_DefaultAction
|
||||||
:L_StartServer
|
:L_StartServer
|
||||||
call %this% start login-server%suffix%.exe
|
call %this% start login-server%suffix%.exe
|
||||||
call %this% start char-server%suffix%.exe
|
call %this% start char-server%suffix%.exe
|
||||||
call %this% start map-server%suffix%.exe
|
call %this% start map-server%suffix%.exe
|
||||||
goto L_EOF
|
goto L_EOF
|
||||||
|
|
||||||
:L_StopServer
|
:L_StopServer
|
||||||
call %this% stop login-server%suffix%.exe
|
call %this% stop login-server%suffix%.exe
|
||||||
call %this% stop char-server%suffix%.exe
|
call %this% stop char-server%suffix%.exe
|
||||||
call %this% stop map-server%suffix%.exe
|
call %this% stop map-server%suffix%.exe
|
||||||
goto L_EOF
|
goto L_EOF
|
||||||
|
|
||||||
:L_StartServerExe
|
:L_StartServerExe
|
||||||
set filename=%2
|
set filename=%2
|
||||||
if "%filename%" == "" goto L_StartServer
|
if "%filename%" == "" goto L_StartServer
|
||||||
if exist %filename% goto L_HaveExe
|
if exist %filename% goto L_HaveExe
|
||||||
echo Cannot start '%filename%' because the file is missing!
|
echo Cannot start '%filename%' because the file is missing!
|
||||||
goto L_EOF
|
goto L_EOF
|
||||||
|
|
||||||
:L_HaveExe
|
:L_HaveExe
|
||||||
echo Starting %filename%...
|
echo Starting %filename%...
|
||||||
start "%filename%" %wndswitch% %this% exec %filename%
|
start "%filename%" %wndswitch% %this% exec %filename%
|
||||||
goto L_EOF
|
goto L_EOF
|
||||||
|
|
||||||
:L_StopServerExe
|
:L_StopServerExe
|
||||||
set filename=%2
|
set filename=%2
|
||||||
if "%filename%" == "" goto L_StopServer
|
if "%filename%" == "" goto L_StopServer
|
||||||
if exist %windir%\system32\taskkill.exe goto L_HaveTaskKill
|
if exist %windir%\system32\taskkill.exe goto L_HaveTaskKill
|
||||||
echo The 'stop' command is not available on your system.
|
echo The 'stop' command is not available on your system.
|
||||||
exit
|
exit
|
||||||
|
|
||||||
:L_HaveTaskKill
|
:L_HaveTaskKill
|
||||||
rem CAUTION! This will kill all processes called %filename%.
|
rem CAUTION! This will kill all processes called %filename%.
|
||||||
echo Stopping '%filename%'...
|
echo Stopping '%filename%'...
|
||||||
taskkill /F /FI "WINDOWTITLE eq %filename% - %this% exec %filename%"
|
taskkill /F /FI "WINDOWTITLE eq %filename% - %this% exec %filename%"
|
||||||
taskkill /F /IM "%filename%"
|
taskkill /F /IM "%filename%"
|
||||||
goto L_EOF
|
goto L_EOF
|
||||||
|
|
||||||
:L_ExecServerExe
|
:L_ExecServerExe
|
||||||
%filename%
|
%filename%
|
||||||
echo .
|
echo .
|
||||||
echo .
|
echo .
|
||||||
echo Server exited, restarting in %SLEEP_TIME% seconds! Press CTRL+C to abort!
|
echo Server exited, restarting in %SLEEP_TIME% seconds! Press CTRL+C to abort!
|
||||||
ping.exe -n %SLEEP_TIME% 127.0.0.1 > nul
|
ping.exe -n %SLEEP_TIME% 127.0.0.1 > nul
|
||||||
goto L_ExecServerExe
|
goto L_ExecServerExe
|
||||||
|
|
||||||
:L_EOF
|
:L_EOF
|
||||||
|
70
start
70
start
@ -1,35 +1,35 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# modified by shazeya@syafi.com (NL130240)
|
# modified by shazeya@syafi.com (NL130240)
|
||||||
|
|
||||||
./athena-start start
|
./athena-start start
|
||||||
sleep 30
|
sleep 30
|
||||||
|
|
||||||
while [ true ]; do
|
while [ true ]; do
|
||||||
if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
|
if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
|
||||||
# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
|
# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
|
||||||
[ " 0" = "$(ps | grep -e char | wc -l)" ] ||
|
[ " 0" = "$(ps | grep -e char | wc -l)" ] ||
|
||||||
[ " 0" = "$(ps | grep -e map | wc -l)" ]; then
|
[ " 0" = "$(ps | grep -e map | wc -l)" ]; then
|
||||||
printf "Error:"
|
printf "Error:"
|
||||||
date
|
date
|
||||||
sleep 10
|
sleep 10
|
||||||
printf "Checking:"
|
printf "Checking:"
|
||||||
date
|
date
|
||||||
if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
|
if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
|
||||||
# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
|
# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
|
||||||
[ " 0" = "$(ps | grep -e char | wc -l)" ] ||
|
[ " 0" = "$(ps | grep -e char | wc -l)" ] ||
|
||||||
[ " 0" = "$(ps | grep -e map | wc -l)" ]; then
|
[ " 0" = "$(ps | grep -e map | wc -l)" ]; then
|
||||||
printf "Error Confirmation:"
|
printf "Error Confirmation:"
|
||||||
date
|
date
|
||||||
printf "Restoration:"
|
printf "Restoration:"
|
||||||
date
|
date
|
||||||
./athena-start start
|
./athena-start start
|
||||||
else
|
else
|
||||||
printf "Check Miss Sorry:"
|
printf "Check Miss Sorry:"
|
||||||
date
|
date
|
||||||
fi
|
fi
|
||||||
# else
|
# else
|
||||||
# printf "Check OK:"
|
# printf "Check OK:"
|
||||||
# date
|
# date
|
||||||
fi
|
fi
|
||||||
sleep 10
|
sleep 10
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user