added rcon password support
This commit is contained in:
parent
7033f672dd
commit
8c5697a883
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
/sqlPass.txt
|
||||
/token.txt
|
||||
/scr/Modules/SSC/ChangeServer/text.txt
|
||||
/rcon.txt
|
||||
|
@ -5,6 +5,7 @@ import os
|
||||
from mcrcon import MCRcon
|
||||
|
||||
password = open("../sqlPass.txt", 'r').read()
|
||||
rcon = open("../rcon.txt", 'r').read()
|
||||
|
||||
con = pymysql.connect(host='localhost',
|
||||
user='Bot',
|
||||
@ -34,10 +35,10 @@ def change(ip1, ip2):
|
||||
os.system("systemctl stop mc mcL mcP mcEvent1 mcEvent2")
|
||||
|
||||
for i in range(len(allServerRcon)):
|
||||
print("192.168.1.52 " + f"{password} " + str(allServerRcon[i]['serverRCON']) + "________________________________________________________________________________________________")
|
||||
print("192.168.1.52 " + f"{rcon} " + str(allServerRcon[i]['serverRCON']) + "________________________________________________________________________________________________")
|
||||
|
||||
for i in range(len(allServerRcon)):
|
||||
with MCRcon("192.168.1.52", f"{password}", port=allServerRcon[i]['serverRCON']) as mcr:
|
||||
with MCRcon("192.168.1.52", f"{rcon}", port=allServerRcon[i]['serverRCON']) as mcr:
|
||||
mcr.command("stop")
|
||||
|
||||
f = open("/etc/systemd/system/mcEvent1.service", "w")
|
||||
|
Loading…
x
Reference in New Issue
Block a user