Merge branch 'master' into install-remove-instances

This commit is contained in:
coderus
2023-02-28 21:57:01 +01:00
22 changed files with 562 additions and 216 deletions

View File

@@ -338,18 +338,6 @@ function fetch_webui_ports() {
#=================== SYSTEM =====================#
#================================================#
function find_klipper_initd() {
local services
services=$(find "${INITD}" -maxdepth 1 -regextype posix-extended -regex "${INITD}/klipper(-[^0])?[0-9]*" | sort)
echo "${services}"
}
function find_klipper_systemd() {
local services
services=$(find "${SYSTEMD}" -maxdepth 1 -regextype posix-extended -regex "${SYSTEMD}/klipper(-[0-9a-zA-Z]+)?.service" | sort)
echo "${services}"
}
function create_required_folders() {
local printer_data=${1} folders
folders=("backup" "certs" "config" "database" "gcodes" "comms" "logs" "systemd")
@@ -599,7 +587,7 @@ function set_multi_instance_names() {
local names=""
local services
services=$(find_klipper_systemd)
services=$(klipper_systemd)
###
# if value of 'multi_instance_names' is not an empty
@@ -686,7 +674,7 @@ function get_config_folders() {
cfg_dirs+=("${HOME}/${name}_data/config")
fi
done
elif [[ -z ${instance_names} && $(find_klipper_systemd | wc -w) -gt 0 ]]; then
elif [[ -z ${instance_names} && $(klipper_systemd | wc -w) -gt 0 ]]; then
cfg_dirs+=("${HOME}/printer_data/config")
else
cfg_dirs=()
@@ -729,7 +717,7 @@ function get_instance_folder_path() {
fi
fi
done
elif [[ -z ${instance_names} && $(find_klipper_systemd | wc -w) -gt 0 ]]; then
elif [[ -z ${instance_names} && $(klipper_systemd | wc -w) -gt 0 ]]; then
path="${HOME}/printer_data/${folder_name}"
if [[ -d ${path} ]]; then
folder_paths+=("${path}")