From 7b73eb571b32e95e93c0795a1b9465e203801325 Mon Sep 17 00:00:00 2001 From: teacup-on-rockingchair <315160+teacup-on-rockingchair@users.noreply.github.com> Date: Sun, 14 Apr 2024 06:49:38 +0300 Subject: [PATCH] Fix bash template to produce shellcheck compliant code --- shared/templates/package_installed_guard_var/bash.template | 2 +- shared/templates/package_removed_guard_var/bash.template | 2 +- shared/templates/service_disabled_guard_var/bash.template | 2 +- shared/templates/service_enabled_guard_var/bash.template | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared/templates/package_installed_guard_var/bash.template b/shared/templates/package_installed_guard_var/bash.template index 61ec0f61f6a..86b03c61821 100644 --- a/shared/templates/package_installed_guard_var/bash.template +++ b/shared/templates/package_installed_guard_var/bash.template @@ -7,7 +7,7 @@ {{{ bash_instantiate_variables(VARIABLE) }}} {{% if OPERATION == "pattern match" %}} - if [[ "{{{ VALUE }}}" =~ "${{{ VARIABLE }}}" ]]; then + if [[ "{{{ VALUE }}}" =~ ${{{ VARIABLE }}} ]]; then {{{ bash_package_install(package=PKGNAME) }}} fi {{% else %}} diff --git a/shared/templates/package_removed_guard_var/bash.template b/shared/templates/package_removed_guard_var/bash.template index d7d5b6b7b85..81cd8b25a4a 100644 --- a/shared/templates/package_removed_guard_var/bash.template +++ b/shared/templates/package_removed_guard_var/bash.template @@ -13,7 +13,7 @@ {{{ bash_instantiate_variables(VARIABLE) }}} {{% if OPERATION == "pattern match" %}} - if ! [[ "{{{ VALUE }}}" =~ "${{{ VARIABLE }}}" ]]; then + if ! [[ "{{{ VALUE }}}" =~ ${{{ VARIABLE }}} ]]; then {{{ bash_package_remove(package=PKGNAME) }}} fi {{% else %}} diff --git a/shared/templates/service_disabled_guard_var/bash.template b/shared/templates/service_disabled_guard_var/bash.template index b175b99fc89..0afd3332d86 100644 --- a/shared/templates/service_disabled_guard_var/bash.template +++ b/shared/templates/service_disabled_guard_var/bash.template @@ -8,7 +8,7 @@ {{{ bash_instantiate_variables(VARIABLE) }}} {{% if OPERATION == "pattern match" %}} -if ! [[ "{{{ VALUE }}}" =~ "${{{ VARIABLE }}}" ]]; +if ! [[ "{{{ VALUE }}}" =~ ${{{ VARIABLE }}} ]]; then {{% else %}} if [ ${{{ VARIABLE }}} != {{{ VALUE }}} ]; then {{%- endif %}} diff --git a/shared/templates/service_enabled_guard_var/bash.template b/shared/templates/service_enabled_guard_var/bash.template index 3cedf2eacfa..12f12bac454 100644 --- a/shared/templates/service_enabled_guard_var/bash.template +++ b/shared/templates/service_enabled_guard_var/bash.template @@ -9,7 +9,7 @@ SYSTEMCTL_EXEC='/usr/bin/systemctl' {{% if OPERATION == "pattern match" %}} -if [[ "{{{ VALUE }}}" =~ "${{{ VARIABLE }}}" ]]; +if [[ "{{{ VALUE }}}" =~ ${{{ VARIABLE }}} ]]; then {{% else %}} if [ ${{{ VARIABLE }}} == {{{ VALUE }}} ]; then {{%- endif %}}