The name extraction should work in case of service-name-with-hyphon-name.service

This commit is contained in:
Kenneth Jiang
2022-07-30 07:38:10 -07:00
parent 08842465b2
commit 121dde5a95

View File

@@ -680,7 +680,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"-" -f1 | rev | cut -d"." -f1)
echo "${name}"
}