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