Cerere script sh restart.sh

Închis
Avatar utilizator
Dionysos
Nivel 1

Nivel 1
Mesaje: 121
Membru din: 12 Ian 2016, 15:29
Aprecieri: 156  
Mulţumiri: 8  
Discord: Copiază ID
Medalii

As dori si eu un script de genul asta dar modificat si functional pe extensiile mele
GAMEDIR="/usr/home/game"
LOG="$GAMEDIR/corerestart.log"

PIDAUTH=`ps aux | grep auth | grep -v grep | awk '{print $2;}'`
if [ "x$PIDAUTH" != "x" ];
then
echo "`date +%d.%m.%Y-%H:%M:%S` :: Auth-Server online! PID: $PIDAUTH"
else
echo "`date +%d.%m.%Y-%H:%M:%S` :: Auth-Server offline!" >> $LOG
echo "`date +%d.%m.%Y-%H:%M:%S` :: Starte Auth-Server..." >> $LOG
cd $GAMEDIR/canale/system/auth
./auth &
sleep 2

fi

PIDDB=`ps aux | grep db | grep -v grep | awk '{print $2;}'`
if [ "x$PIDDB" != "x" ];
then
echo "`date +%d.%m.%Y-%H:%M:%S` :: DB-Server online! PID: $PIDDB"
else
echo "`date +%d.%m.%Y-%H:%M:%S`:: DB-Server offline!" >> $LOG
echo "`date +%d.%m.%Y-%H:%M:%S` :: Starte DB-Server & Game-Cores..." >> $LOG
cd $GAMEDIR/canale/system/db && ./db &
sleep 2
cd $GAMEDIR/canale/system/auth && ./auth &
sleep 2
cd $GAMEDIR/canale/canal1/core1 && ./game &
sleep 2
cd $GAMEDIR/canale/canal1/core4 && ./game1_4 &
sleep 2
cd $GAMEDIR/canale/game99/ && ./game_1 &
sleep 2
cd $GAMEDIR/canale/game99/core2 && ./game_2 &
sleep 2
cd $GAMEDIR/canale/game99/core3 && ./game_3 &
sleep 2
fi

PIDGAME0=`ps aux | grep game99_1 | grep -v grep | awk '{print $2;}'`
if [ "x$PIDGAME0" != "x" ];
then
echo "`date +%d.%m.%Y-%H:%M:%S` :: game99_1 online! PID: $PIDGAME0"
else
echo "`date +%d.%m.%Y-%H:%M:%S` :: game99_1 offline!" >> $LOG
echo "`date +%d.%m.%Y-%H:%M:%S` :: Starte game99_1..." >> $LOG
cd $GAMEDIR/canale/game99//
./game_1 &

fi

PIDGAME0=`ps aux | grep game99_2 | grep -v grep | awk '{print $2;}'`
if [ "x$PIDGAME0" != "x" ];
then
echo "`date +%d.%m.%Y-%H:%M:%S` :: game99_2 online! PID: $PIDGAME0"
else
echo "`date +%d.%m.%Y-%H:%M:%S` :: game99_2 offline!" >> $LOG
echo "`date +%d.%m.%Y-%H:%M:%S` :: Starte game99_2..." >> $LOG
cd $GAMEDIR/canale/game99/core2/
./game_2 &

fi

PIDGAME0=`ps aux | grep game99_3 | grep -v grep | awk '{print $2;}'`
if [ "x$PIDGAME0" != "x" ];
then
echo "`date +%d.%m.%Y-%H:%M:%S` :: game99_3 online! PID: $PIDGAME0"
else
echo "`date +%d.%m.%Y-%H:%M:%S` :: game99_3 offline!" >> $LOG
echo "`date +%d.%m.%Y-%H:%M:%S` :: Starte game99_3..." >> $LOG
cd $GAMEDIR/canale/game99/core3/
./game_3 &

fi

PIDGAME1=`ps aux | grep game1_1 | grep -v grep | awk '{print $2;}'`
if [ "x$PIDGAME1" != "x" ];
then
echo "`date +%d.%m.%Y-%H:%M:%S` :: game1_1 online! PID: $PIDGAME1"
else
echo "`date +%d.%m.%Y-%H:%M:%S` :: game1_1_CH1 offline!" >> $LOG
echo "`date +%d.%m.%Y-%H:%M:%S` :: Starte game1_1_CH1..." >> $LOG
cd $GAMEDIR/canale/canal1/core1
./game &

fi

PIDGAME2=`ps aux | grep game1_2 | grep -v grep | awk '{print $2;}'`
if [ "x$PIDGAME2" != "x" ];
then
echo "`date +%d.%m.%Y-%H:%M:%S` :: game1_2 online! PID: $PIDGAME2"
else
echo "`date +%d.%m.%Y-%H:%M:%S` :: game1_2_CH1 offline!" >> $LOG
echo "`date +%d.%m.%Y-%H:%M:%S` :: Starte game1_2_CH1..." >> $LOG
cd $GAMEDIR/canale/canal1/core2
./game &

fi

PIDGAME3=`ps aux | grep game1_3 | grep -v grep | awk '{print $2;}'`
if [ "x$PIDGAME3" != "x" ];
then
echo "`date +%d.%m.%Y-%H:%M:%S` :: game1_3 online! PID: $PIDGAME3"
else
echo "`date +%d.%m.%Y-%H:%M:%S` :: game1_3_CH1 offline!" >> $LOG
echo "`date +%d.%m.%Y-%H:%M:%S` :: Starte game1_3_CH1..." >> $LOG
cd $GAMEDIR/canale/canal1/core3
./game &

fi

PIDGAME4=`ps aux | grep game1_4 | grep -v grep | awk '{print $2;}'`
if [ "x$PIDGAME4" != "x" ];
then
echo "`date +%d.%m.%Y-%H:%M:%S` :: game1_4 online! PID: $PIDGAME4"
else
echo "`date +%d.%m.%Y-%H:%M:%S` :: game1_4_CH1 offline!" >> $LOG
echo "`date +%d.%m.%Y-%H:%M:%S` :: Starte game1_4_CH1..." >> $LOG
cd $GAMEDIR/canale/canal1/core4
./game1_4 &

fi
;;

/usr/home/game/channel1 ARE core1 & core2
/usr/home/game/channel2 core1 & core2
/usr/home/game/channel3 core1 & core2
/usr/home/game/channel4 core1 & core2
/usr/home/game/game99 core1 & core2
/usr/home/game/package -
/usr/home/game/system ARE auth , chat, db si server_config
Avatar utilizator
Frank
Nivel 4

Nivel 4
Mesaje: 667
Membru din: 12 Mar 2015, 22:59
Server: ---
Regat: Chunjo
Aprecieri: 44  
Mulţumiri: 28  
 Contact:
Medalii

Arhiva.
Imagine
Afișează semnătura
Închis
Răspunsuri
1
Vizualizări
189
Răspunsuri
4
Vizualizări
294
Răspunsuri
6
Vizualizări
400
Răspunsuri
2
Vizualizări
192

Înapoi la “Arhivă”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 12 vizitatori