#!/bin/sh
# athena starting script by rowla
# modified by
[email protected] (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
[email protected]"
echo ""
#echo "Debug informations will appear,"
#echo "since this is a test release."
#echo ""
echo "checking..."
#EOF
}
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_files
exec screen -d -m -S login .{L_SRV}&
exec screen -d -m -S char ./${C_SRV}&
exec screen -d -m -S map ./${M_SRV}&
echo "Now Started Athena."
echo "To view one of the servers type as shown:"
echo "Login: screen -r login"
echo "Char : screen -r char"
echo "Map : screen -r map"
echo "To stop viewing a screen hold Ctrl+A and tap D"
;;
'stop')
ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill
;;
'restart')
$0 stop
$0 start
;;
*)
echo "Usage: athena-start { start | stop | restart }"
;;
esac
as you wish sir.