From 7c4b413c671a3edbbe52b4d679ebd14793de58cf Mon Sep 17 00:00:00 2001 From: th33xitus Date: Mon, 15 Aug 2022 13:07:25 +0200 Subject: [PATCH] refactor: improve `get_instance_name` function Signed-off-by: Dominik Willner --- scripts/obico.sh | 3 ++- scripts/utilities.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/obico.sh b/scripts/obico.sh index 30b95d9..5ccca70 100644 --- a/scripts/obico.sh +++ b/scripts/obico.sh @@ -103,7 +103,8 @@ function moonraker_obico_setup_dialog() { if (( existing_moonraker_obico_count > 0 )); then printf "|${green}%-55s${white}|\n" " ${existing_moonraker_obico_count} Moonraker-obico instances already installed!" for svc in ${moonraker_obico_services}; do - printf "|${cyan}%-57s${white}|\n" " ● moonraker-obco-$(get_instance_name "${svc}" moonraker-obico)" +# printf "|${cyan}%-57s${white}|\n" " ● moonraker-obco-$(get_instance_name "${svc}" moonraker-obico)" + printf "|${cyan}%-57s${white}|\n" " ● moonraker-obco-$(get_instance_name "${svc}")" done fi blank_line diff --git a/scripts/utilities.sh b/scripts/utilities.sh index 2efc20e..2940e90 100644 --- a/scripts/utilities.sh +++ b/scripts/utilities.sh @@ -676,7 +676,7 @@ function set_hostname() { ### returns: name function get_instance_name() { local instance=${1} name - name=$(echo "${instance}" | rev | cut -d"/" -f1 | rev | cut -d"-" -f2 | cut -d"." -f1) + name=$(echo "${instance}" | rev | cut -d"/" -f1 | cut -d"." -f2 | cut -d"-" -f1 | rev) echo "${name}" }