#!/bin/bash
run=1
if [ "$run" -eq 1 ]; then
if [ $(ps | grep -e login-server | wc -l) -eq 0 ]; then
# Login server down
/home/RO_User01/rewrite/login-server_sql & > /dev/null
fi
if [ $(ps | grep -e char-server | wc -l) -eq 0 ]; then
# Char server down
/home/RO_User01/rewrite/char-server_sql & > /dev/null
fi
if [ $(ps | grep -e map-server | wc -l) -eq 0 ]; then
# Map server down
/home/RO_User01/rewrite/map-server_sql & > /dev/null
fi
sleep 10
/home/RO_User01/rewrite/auto-restarter.sh start &
fi
saved it as autorestart.sh , then I issue the command ...
chmod 755 /etc/init.d/autorestart.sh
then issue this command ...
update-rc.d autorestart.sh defaults
i thought that if i use this line
sleep 10
/home/RO_User01/rewrite/auto-restarter.sh start &
fi
this will run the auto-restarter.sh and make the whole thing auto run if ever the server shuts down, but did not work.
HI!
I tried to do this http://www.debian-administration.org/articles/28 in order to make my RO autostarts when server reboots accidentally.
saved it as autorestart.sh , then I issue the command ...
then issue this command ...
i thought that if i use this line
this will run the auto-restarter.sh and make the whole thing auto run if ever the server shuts down, but did not work.
please help.
Link to comment
Share on other sites