Skip to forum content

You are not logged in. Please login or register.


forums.pvpgn.pro → [EN] Diablo → [Guide][Script]Sending warning message

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 3

1

Topic: [Guide][Script]Sending warning message

I made a very useful script and I will share it with you.

I always restart my D2GS every seven days, so I made a bash script to always warn the Players when it will go into maintenance.

To create the script to restart the D2GS is to follow the same logic and to add in the crontab the scripts.


message.sh

#!/bin/bash
#
# set as variables
# password
passwd=abcd123
# message
msg="Hello World"
# d2gs telnet address
server="localhost 8888"
#
(echo $passwd; sleep 1;echo "msg sys #all \"$msg\" "; sleep 1) | telnet $server

Any questions please..

2

Re: [Guide][Script]Sending warning message

Nice, simple and clean - I like it big_smile


I also have a basic bash script which will boot D2GS.exe if it disappears (crash attack). If people want it, I will post it up.

Admin of Slash Diablo & Diablo2.org (coming soon).

Also check out Slash's Character Armory!

3

Re: [Guide][Script]Sending warning message

Feofilaktt wrote:

I made a very useful script and I will share it with you.

I always restart my D2GS every seven days, so I made a bash script to always warn the Players when it will go into maintenance.

To create the script to restart the D2GS is to follow the same logic and to add in the crontab the scripts.


message.sh

#!/bin/bash
#
# set as variables
# password
passwd=abcd123
# message
msg="Hello World"
# d2gs telnet address
server="localhost 8888"
#
(echo $passwd; sleep 1;echo "msg sys #all \"$msg\" "; sleep 1) | telnet $server

Any questions please..

your thing worked just fine for me. i just feel i should add some details

visit   https://crontab-generator.org/

choose interval

Command To Execute is the .sh file directory (mine is "/home/d2gs/restart_gs.sh")

copy the output (something like "0 */2 * * * /home/d2gs/restart_gs.sh >/dev/null 2>&1")

now on your vps(mine is CentOS):

crontab -e
i   #(to be able to insert)
paste previous output
esc
:wq

i merged announce and restart in one script

restart_gs.sh

#!/bin/bash
#
# set as variables
# password
passwd=abcd123
# message
msg="This host will restart in 2 minutes."
# d2gs telnet address
server="localhost 8888"
#
(echo $passwd; sleep 1;echo "msg sys #all \"$msg\" "; sleep 1;echo restart 121;sleep 1) | telnet $server

i'm waiting for Meanski to post his thing, meanwhile looking how to change the notification messages interval. every 15 sec is kinda too annoying

Posts: 3

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]Sending warning message



Generated in 0.078 seconds (79% PHP - 21% DB) with 23 queries