mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-26 01:03:35 +05:00
fix: better check for still existing services during removal
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -18,6 +18,7 @@ from core.logger import Logger
|
|||||||
from utils.fs_utils import run_remove_routines
|
from utils.fs_utils import run_remove_routines
|
||||||
from utils.input_utils import get_selection_input
|
from utils.input_utils import get_selection_input
|
||||||
from utils.instance_utils import get_instances
|
from utils.instance_utils import get_instances
|
||||||
|
from utils.sys_utils import unit_file_exists
|
||||||
|
|
||||||
|
|
||||||
def run_klipper_removal(
|
def run_klipper_removal(
|
||||||
@@ -35,7 +36,7 @@ def run_klipper_removal(
|
|||||||
else:
|
else:
|
||||||
Logger.print_info("No Klipper Services installed! Skipped ...")
|
Logger.print_info("No Klipper Services installed! Skipped ...")
|
||||||
|
|
||||||
if (remove_dir or remove_env) and klipper_instances:
|
if (remove_dir or remove_env) and unit_file_exists("klipper", suffix="service"):
|
||||||
Logger.print_info("There are still other Klipper services installed:")
|
Logger.print_info("There are still other Klipper services installed:")
|
||||||
Logger.print_info(f"● '{KLIPPER_DIR}' was not removed.", prefix=False)
|
Logger.print_info(f"● '{KLIPPER_DIR}' was not removed.", prefix=False)
|
||||||
Logger.print_info(f"● '{KLIPPER_ENV_DIR}' was not removed.", prefix=False)
|
Logger.print_info(f"● '{KLIPPER_ENV_DIR}' was not removed.", prefix=False)
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ from core.logger import Logger
|
|||||||
from utils.fs_utils import run_remove_routines
|
from utils.fs_utils import run_remove_routines
|
||||||
from utils.input_utils import get_selection_input
|
from utils.input_utils import get_selection_input
|
||||||
from utils.instance_utils import get_instances
|
from utils.instance_utils import get_instances
|
||||||
|
from utils.sys_utils import unit_file_exists
|
||||||
|
|
||||||
|
|
||||||
def run_moonraker_removal(
|
def run_moonraker_removal(
|
||||||
@@ -37,7 +38,8 @@ def run_moonraker_removal(
|
|||||||
else:
|
else:
|
||||||
Logger.print_info("No Moonraker Services installed! Skipped ...")
|
Logger.print_info("No Moonraker Services installed! Skipped ...")
|
||||||
|
|
||||||
if (remove_polkit or remove_dir or remove_env) and instances:
|
delete_remaining: bool = remove_polkit or remove_dir or remove_env
|
||||||
|
if delete_remaining and unit_file_exists("moonraker", suffix="service"):
|
||||||
Logger.print_info("There are still other Moonraker services installed")
|
Logger.print_info("There are still other Moonraker services installed")
|
||||||
Logger.print_info(
|
Logger.print_info(
|
||||||
"● Moonraker PolicyKit rules were not removed.", prefix=False
|
"● Moonraker PolicyKit rules were not removed.", prefix=False
|
||||||
|
|||||||
Reference in New Issue
Block a user