Jump to content
  • 0

how to implement auto server restart


Question

Posted

i am using the code below and save it as auto-restarter.sh

then i put it to my /home/testro

then what will be the next step?

#!/bin/bash
run=1
if [ "$run" -eq 1 ]; then
if [ $(ps | grep -e login-server | wc -l) -eq 0 ]; then
# Login server down
./login-server_sql & > /dev/null
fi
if [ $(ps | grep -e char-server | wc -l) -eq 0 ]; then
# Char server down
./char-server_sql & > /dev/null
fi
if [ $(ps | grep -e map-server | wc -l) -eq 0 ]; then
# Map server down
./map-server_sql & > /dev/null
fi
sleep 10
./auto-restarter.sh &
fi

2 answers to this question

Recommended Posts

Posted

Surprised nobody answered this one!

1. Put that file auto-restarter.sh in your rathena folder.

2. make sure you chmod so you don't get any permission errors when running it

3. make sure your server is off with ./athena-start stop and then use ./auto-restarter.sh to run your server.

If the login/char/map server every fail and go offline, it will automatically boot that server back up for you.

The main thing here is when you start the server, don't use ./athena-start start, but use ./auto-restarter.sh

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...