Skip to content

Commit

Permalink
Fix shellcheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubrak committed Dec 13, 2024
1 parent 563e7aa commit ba1ba91
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_file_content(self, address: str, file: Path) -> CommandResult:
return self.executor.execute(address, "type", str(file))

def file_exists(self, address: str, file: Path) -> CommandResult:
# Windows needs double quoting for passing paths containing
# Windows needs double quoting for passing paths
# containing spaces, single quotes don't work
return self.executor.execute(
address, f'if exist "{file}" (exit 0) else (exit 1)')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash -eu

# This script acts as a self contained installer of the procuct

Expand All @@ -9,16 +9,18 @@ readonly INSTALLER_VERSION="##VERSION##"
readonly DEPLOYMENT_CONF_PATH="/var/lib/dynatrace/oneagent/agent/config"

readonly UNINSTALL_SCRIPT="uninstall.sh"
readonly UNINSTALL_CODE="$(cat <<-ENDUNINSTALL
UNINSTALL_CODE="$(cat <<-ENDUNINSTALL
##UNINSTALL_CODE##
ENDUNINSTALL
)"
readonly UNINSTALL_CODE

readonly ONEAGENTCTL_BIN="oneagentctl"
readonly ONEAGENTCTL_CODE="$(cat <<-ENDCTL
ONEAGENTCTL_CODE="$(cat <<-ENDCTL
##ONEAGENTCTL_CODE##
ENDCTL
)"
readonly ONEAGENTCTL_CODE

CTL_PARAMS=
INSTALL_DIR="${DEFAULT_INSTALL_DIR}"
Expand Down Expand Up @@ -61,7 +63,7 @@ deployUninstallScript() {
}

applyConfig() {
"${INSTALL_DIR}/agent/tools/${ONEAGENTCTL_BIN}" ${CTL_PARAMS}
"${INSTALL_DIR}/agent/tools/${ONEAGENTCTL_BIN}" "${CTL_PARAMS}"
}

main() {
Expand Down
2 changes: 1 addition & 1 deletion roles/oneagent/tests/resources/installers/oneagentctl.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -eu

# This file simulates deployment functionalities of oneagentctl binary, used to configure installation.

Expand Down
2 changes: 1 addition & 1 deletion roles/oneagent/tests/resources/installers/uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash -eu

# This file simulates the basic behavior of the uninstall.sh script

Expand Down

0 comments on commit ba1ba91

Please sign in to comment.