unzwar sobald ich sh start.sh eingebe kommt folgender
Fehler in Putty :
start.sh script :
PHP Code:
#!/usr/local/bin/zsh
basepath=/usr/home/m2user/metin2
if [ "$UID" -eq 0 ]
then
echo -e "\033[31m Sorry, but you can not start the server as \"root\".\n Please use the user \"metin2\"\033[0m"
exit
fi
cd $basepath
echo -e "\033[31m
Wie viele Channels möchtest du starten ? \n
(1) - 1 Channel\n
(2) - 2 Channels\n
(3) - 3 Channels\n
(4) - 4 Channels\033[0m"
function findLibs {
ld_preload=""
lib_path="$basepath/share/libs/"
lib_name=""
if [ "$1" = "db" ]
then
lib_name="libdb_*.so"
elif [ "$1" = "game" ]
then
lib_name="libgame_*.so"
else
lib_name="*.so"
fi
for library in `find $basepath/share/libs -name $lib_name`
do
if [ "$ld_preload" = "" ]
then
ld_preload="$library"
else
ld_preload="$ld_preload $library"
fi
done
echo $ld_preload
}
function startDatabase {
cd $basepath
echo -e "\033[31m \n Starting database server..\033[0m"
cd ./db
if [ -f pid ] && ps ax | grep -v grep | grep `cat pid` > /dev/null
then
echo -e "\033[31m \n database server already running..\033[0m"
else
if [ `getconf LONG_BIT` = "64" ]
then
LD_32_PRELOAD=`findLibs db` ./db &
else
LD_PRELOAD=`findLibs db` ./db &
fi
sleep 3
echo -e "\033[31m \n database server started..\033[0m"
fi
sleep 1
cd $basepath
}
function startAuth {
cd $basepath
echo -e "\033[31m \n Starting login server..\033[0m"
cd ./login
if [ -f pid ] && ps ax | grep -v grep | grep `cat pid` > /dev/null
then
echo -e "\033[31m \n Loginserver already running..\033[0m"
else
sleep 3
LD_32_PRELOAD=`findLibs game` ./auth &
echo -e "\033[31m \n Loginserver started..\033[0m"
fi
sleep 2
cd $basepath
}
function startMe {
echo -e "\033[31m \n Starting $1; Core: $2..\033[0m"
if [[ -e $3 ]]
then
cd ./$3
if [ -f pid ] && ps ax | grep -v grep | grep `cat pid` > /dev/null
then
echo -e "\033[31m \n $1 core $2 already running..\033[0m"
else
LD_32_PRELOAD=$5 ./$4 &
fi
cd -
fi
}
function startCore {
cd $basepath/$1
preload_string=`findLibs game`
if [ "$1" = "special" ]
then
startMe $1 "Event-Core" "core_event" "game_event" $preload_string
startMe $1 "Eventmaps" "core_eventmaps" "game_eventmap" $preload_string
startMe $1 "Nemere" "core_nemere" "game_nemere" $preload_string
startMe $1 "Baroness" "core_baroness" "game_baroness" $preload_string
startMe $1 "Azrael" "core_azrael" "game_azrael" $preload_string
startMe $1 "Blazing" "core_blazing" "game_blazing" $preload_string
else
startMe $1 "Core 1" "core1" "game_$1_core1" $preload_string
startMe $1 "Core 2" "core2" "game_$1_core2" $preload_string
startMe $1 "Core 3" "core3" "game_$1_core3" $preload_string
startMe $1 "Farmcore 1" "farmcore1" "game_$1_farm1" $preload_string
startMe $1 "Farmcore 2" "farmcore2" "game_$1_farm2" $preload_string
startMe $1 "Farmcore 3" "farmcore3" "game_$1_farm3" $preload_string
fi
cd $basepath
echo -e "\033[31m \n $1 started..\033[0m";
}
read channels
# $basepath/clear.sh
case $channels in
1*)
startDatabase
startCore special
startCore ch1
startAuth
;;
2*)
startDatabase
startCore special
startCore ch1
startCore ch2
startAuth
;;
3*)
startDatabase
startCore special
startCore ch1
startCore ch2
startCore ch3
startAuth
;;
4*)
startDatabase
startCore special
startCore ch1
startCore ch2
startCore ch3
startCore ch4
startAuth
;;
db*)
startDatabase
;;
login*)
startAuth
;;
esac
Mfg






