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