mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-23 15:53:36 +05:00
Compare commits
2 Commits
1620efe56c
...
8df75dc8d0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8df75dc8d0 | ||
|
|
5c37b68463 |
@@ -53,12 +53,16 @@ def remove_client_config_dir(client_config: ClientConfigData) -> None:
|
|||||||
|
|
||||||
|
|
||||||
def remove_client_config_symlink(client_config: ClientConfigData) -> None:
|
def remove_client_config_symlink(client_config: ClientConfigData) -> None:
|
||||||
Logger.print_status(f"Removing {client_config.get('cfg_filename')} symlinks ...")
|
|
||||||
im = InstanceManager(Klipper)
|
im = InstanceManager(Klipper)
|
||||||
instances: List[Klipper] = im.instances
|
instances: List[Klipper] = im.instances
|
||||||
for instance in instances:
|
for instance in instances:
|
||||||
Logger.print_status(f"Removing symlink from '{instance.cfg_file}' ...")
|
Logger.print_status(f"Removing symlink from '{instance.cfg_file}' ...")
|
||||||
|
symlink = instance.cfg_dir.joinpath(client_config.get("cfg_filename"))
|
||||||
|
if not symlink.exists():
|
||||||
|
Logger.print_info(f"'{symlink}' does not exist. Skipping ...")
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
remove_file(instance.cfg_dir.joinpath(client_config.get("cfg_filename")))
|
remove_file(symlink)
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
Logger.print_error("Failed to remove symlink!")
|
Logger.print_error("Failed to remove symlink!")
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ def print_client_port_select_dialog(name: str, port: str, ports_in_use: List[str
|
|||||||
| {line2:<54}|
|
| {line2:<54}|
|
||||||
| port, you can set it now. Make sure the port is not |
|
| port, you can set it now. Make sure the port is not |
|
||||||
| used by any other application on your system! |
|
| used by any other application on your system! |
|
||||||
\\=======================================================/
|
|
||||||
"""
|
"""
|
||||||
)[1:]
|
)[1:]
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,8 @@ def install_client(client_name: ClientName) -> None:
|
|||||||
install_client_cfg = get_confirm(question, allow_go_back=False)
|
install_client_cfg = get_confirm(question, allow_go_back=False)
|
||||||
|
|
||||||
cm = ConfigManager(cfg_file=KIAUH_CFG)
|
cm = ConfigManager(cfg_file=KIAUH_CFG)
|
||||||
client_port = cm.get_value(client.get("name"), "port")
|
default_port = cm.get_value(client.get("name"), "port")
|
||||||
|
client_port = default_port if default_port and default_port.isdigit() else "80"
|
||||||
ports_in_use = read_ports_from_nginx_configs()
|
ports_in_use = read_ports_from_nginx_configs()
|
||||||
|
|
||||||
# check if configured port is a valid number and not in use already
|
# check if configured port is a valid number and not in use already
|
||||||
|
|||||||
Reference in New Issue
Block a user