Skip to forum content

You are not logged in. Please login or register.


forums.pvpgn.pro → [EN] Diablo → [Guide][Script]Auto-Restart D2GS

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 1

1

Topic: [Guide][Script]Auto-Restart D2GS

Here's a simple script to restart D2GS in case of crashes.

Code Bash

#!/bin/bash
#######################
# Script to monitor process #
#######################
# Name of process to be filtered
PROCESSO="D2GS"
# interval to be checked (in seconds)
INTERVALO=10
while true
do
# number of process copies running
OCORRENCIAS=`ps ax | grep $PROCESSO | grep -v grep| wc -l`
if [ $OCORRENCIAS -eq 0 ]
then
# If the number of processes running is 0, specify the actions to be taken.
wine /root/d2gs/D2GS.exe &
fi
sleep $INTERVALO
done

NOTE: Remember to change the path(directory) of your D2GS in script.
Exemple: wine /root/d2gs/D2GS.exe &


After the script is created, you must give it permission to execute.

chmod +x yourscript.sh

Okay, now just run your script.

NOTE: Do not use the name "D2GS" in your script title (ex: d2gs-script.sh) as it may double check and cause the process to fail to check.

Diablo 2 Online

Itens - Armory - Market - Clans - Builds - Chat

Posts: 1

Pages 1

You must login or register to post a reply

Who now at forum

Currently view post: 0 guests, 0 registered users

forums.pvpgn.pro → [EN] Diablo → [Guide][Script]Auto-Restart D2GS