Bugs primarily caused by the confusion between space-separated vars and arrays
This commit is contained in:
@@ -35,8 +35,11 @@ function moonraker_obico_needs_linking() {
|
|||||||
if [[ ! -f "${moonraker_obico_cfg}" ]]; then
|
if [[ ! -f "${moonraker_obico_cfg}" ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
grep -s -E "^[^#]" "${moonraker_obico_cfg}" | grep -vq 'auth_token'
|
if grep -s -E "^[^#]" "${moonraker_obico_cfg}" | grep -q 'auth_token'; then
|
||||||
return $?
|
return 1
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function obico_server_url_prompt() {
|
function obico_server_url_prompt() {
|
||||||
@@ -91,8 +94,8 @@ function moonraker_obico_setup_dialog() {
|
|||||||
blank_line
|
blank_line
|
||||||
if (( existing_moonraker_obico_count > 0 )); then
|
if (( existing_moonraker_obico_count > 0 )); then
|
||||||
printf "|${green}%-55s${white}|\n" " ${existing_moonraker_obico_count} Moonraker-obico instances already installed!"
|
printf "|${green}%-55s${white}|\n" " ${existing_moonraker_obico_count} Moonraker-obico instances already installed!"
|
||||||
for svc in "${moonraker_obico_services}"; do
|
for svc in ${moonraker_obico_services}; do
|
||||||
printf "|${cyan}%-57s${white}|\n" " ● moonraker-obco-$(get_instance_name "${service}" moonraker-obico)"
|
printf "|${cyan}%-57s${white}|\n" " ● moonraker-obco-$(get_instance_name "${svc}" moonraker-obico)"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
blank_line
|
blank_line
|
||||||
@@ -202,7 +205,7 @@ function moonraker_obico_setup_dialog() {
|
|||||||
else
|
else
|
||||||
printf "|${green}%-55s${white}|\n" " ${#not_linked_instances[@]} Moonraker-obico instances not linked to the server!"
|
printf "|${green}%-55s${white}|\n" " ${#not_linked_instances[@]} Moonraker-obico instances not linked to the server!"
|
||||||
for i in "${not_linked_instances[@]}"; do
|
for i in "${not_linked_instances[@]}"; do
|
||||||
printf "|${cyan}%-57s${white}|\n" " ● moonraker-obico-{moonraker_names[i]}"
|
printf "|${cyan}%-57s${white}|\n" " ● moonraker-obico-${moonraker_names[${i}]}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
blank_line
|
blank_line
|
||||||
@@ -251,7 +254,7 @@ function clone_moonraker_obico() {
|
|||||||
|
|
||||||
status_msg "Cloning Moonraker-obico from ${repo} ..."
|
status_msg "Cloning Moonraker-obico from ${repo} ..."
|
||||||
### force remove existing Moonraker-obico dir
|
### force remove existing Moonraker-obico dir
|
||||||
[[ -d ${repo} ]] && rm -rf "${MOONRAKER_OBICO_DIR}"
|
[[ -d "${MOONRAKER_OBICO_DIR}" ]] && rm -rf "${MOONRAKER_OBICO_DIR}"
|
||||||
|
|
||||||
cd "${HOME}" || exit 1
|
cd "${HOME}" || exit 1
|
||||||
if ! git clone "${repo}" "${MOONRAKER_OBICO_DIR}"; then
|
if ! git clone "${repo}" "${MOONRAKER_OBICO_DIR}"; then
|
||||||
|
|||||||
@@ -771,7 +771,7 @@ function get_config_folders() {
|
|||||||
instance_names=$(get_multi_instance_names)
|
instance_names=$(get_multi_instance_names)
|
||||||
|
|
||||||
if [[ -n ${instance_names} ]]; then
|
if [[ -n ${instance_names} ]]; then
|
||||||
for name in "${instance_names}"; do
|
for name in ${instance_names}; do
|
||||||
###
|
###
|
||||||
# by KIAUH convention, all instance names of only numbers
|
# by KIAUH convention, all instance names of only numbers
|
||||||
# need to be prefixed with 'printer_'
|
# need to be prefixed with 'printer_'
|
||||||
|
|||||||
Reference in New Issue
Block a user