This is mine for Chronicles of Norrath.
start
Code:
#!/bin/sh
cd /home/eq1
cp eqtime.bak eqtime.cfg
#ulimit -c 99999999
rm -f .zone_shutdown
rm -f .world_shutdown
set -x
P=`pwd`
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$P"
#make sure we have a place to log
mkdir -p logs 2>&1 > /dev/null
#clear out old logs, if both are stopped
if [ ! -e .lock-zones -a ! -e .lock-world ] ; then
for f in logs/eqemu_*.log
do
if [ "$f" = "logs/eqemu_commands_zone.log" ]; then
continue;
fi
rm -f $f
done
fi
#start up the Shared Memory
if [ ! -e .lock-memory ]; then
touch .lock-memory
./shared_memory 2>&1 > logs/shared_memory &
sleep 3
fi
#start up the logon server
if [ ! -e .lock-login ]; then
touch .lock-login
cd loginserver
./loginserver &
cd ..
sleep 2
fi
#boot up world
if [ ! -e .lock-world ] ; then
touch .lock-world
./world 2>&1 > logs/world &
# wait for shared memory to load
sleep 15
fi
#start up the chat server
if [ ! -e .lock-ucs ]; then
touch .lock-ucs
./ucs &
sleep 5
fi
#start up Queryserv
if [ ! -e .lock-queryserv ]; then
touch .lock-queryserv
./queryserv &
fi
#start up the official launcher
if [ ! -e .lock-static ]; then
touch .lock-static
./eqlaunch static 2>&1 > logs/static &
sleep 30
fi
#start up the official launcher
if [ ! -e .lock-launcher ]; then
touch .lock-launcher
./eqlaunch zone 2>&1 > logs/launcher &
sleep 30
fi
STOP
Code:
#!/bin/sh
touch .zone_shutdown
touch .world_shutdown
killall world ucs eqlaunch zone queryserv loginserver
sleep 3
if ps ax|grep -e ucs -e w[o]rld -e z[o]ne -e eq[l]aunch -equeryserv -e [eqe]mu[l]ogin[s]erve >/dev/null; then
killall -9 ucs world eqlaunch zone queryserv static loginserver
sleep 2
fi
rm -f .lock-ucs .lock-zones .lock-world .lock-launcher .lock-queryserv .lock-memory .lock-static .lock-login