This commit is contained in:
Евгений Храмов 2023-05-16 00:34:05 +03:00
parent 5fc0e5cf10
commit 34ceffbfef

13
hlna.py

@ -654,7 +654,7 @@ def restart(g, m):
def check_exist_servers(g):
print_line("check_exist")
"""Проверяет наличие конфигов для активных карт"""
if g == "ark":
if list_config == []:
@ -666,10 +666,8 @@ def check_exist_servers(g):
def start_stop(action, g, m, list_config=list_config):
print_line("Вход в start_stop", g)
"""Функция изменения статусов сервера"""
if g == "ark":
print_line("g_ark")
check_exist_servers(g)
dict_mapname = {}
dict_allmapname = []
@ -689,11 +687,16 @@ def start_stop(action, g, m, list_config=list_config):
names_serverstart = choose_map(names_serverstart)
for i in names_serverstart:
data = read_yaml(i, game="ARK")
y = os.system(
f"~/git/hln-a/hlna.py rcon SaveWorld -m {i}") if action == "restart" or action == "stop" else ""
if stop or restart:
y = os.system(
f"~/git/hln-a/hlna.py rcon SaveWorld -m {i}") if action == "restart" or action == "stop" else ""
if y == 0:
print_line("Мир сохранён")
x = os.system(f"systemctl --user {action} ark_{data['SessionName'].lower()}.service")
if x == 0:
print_line("Готово")
elif g == "7days":
x = os.system(f"systemctl --user {action} 7days.service")
if x == 0: