Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(unattended): remove quotes that messed up database package selection #4139

Merged
merged 5 commits into from
May 23, 2024

Conversation

mushroomempires
Copy link
Contributor

Description

Fixes # (issue)

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software

Target serie

  • 22.04.x
  • 22.10.x
  • 23.04.x
  • 23.10.x
  • 24.04.x (master)

How this pull request can be tested ?

Please describe the procedure to verify that the goal of the PR is matched. Provide clear instructions so that it can be correctly tested.

Any relevant details of the configuration to perform the test should be added.

Checklist

Community contributors & Centreon team

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have rebased my development branch on the base branch (master, maintenance).

@mushroomempires mushroomempires marked this pull request as ready for review May 20, 2024 13:59
@mushroomempires mushroomempires requested a review from a team as a code owner May 20, 2024 13:59
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 237aa48 and d880c0a.
Files selected for processing (1)
  • centreon/unattended.sh (1 hunks)
Additional Context Used
ShellCheck (114)
centreon/unattended.sh (114)

[info] 11-11: Double quote to prevent globbing and word splitting.


[info] 39-39: Double quote to prevent globbing and word splitting.


[info] 41-41: Double quote to prevent globbing and word splitting.


[warning] 43-43: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.


[style] 43-43: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 49-49: Double quote to prevent globbing and word splitting.


[warning] 53-53: CENTREON_RELEASE_VERSION appears unused. Verify use (or export if used externally).


[warning] 128-128: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.


[info] 175-175: Double quote to prevent globbing and word splitting.


[info] 200-200: Double quote to prevent globbing and word splitting.


[warning] 209-209: The surrounding quotes actually unquote this. Remove or escape them.


[info] 209-209: Double quote to prevent globbing and word splitting.


[info] 211-211: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


[info] 216-216: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


[warning] 220-220: The surrounding quotes actually unquote this. Remove or escape them.


[info] 220-220: Double quote to prevent globbing and word splitting.


[info] 222-222: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


[error] 263-263: -n doesn't work with unquoted arguments. Quote or use [[ ]].


[info] 263-263: Double quote to prevent globbing and word splitting.


[info] 266-266: read without -r will mangle backslashes.


[info] 266-266: Double quote to prevent globbing and word splitting.


[style] 336-336: Use [ -n .. ] instead of ! [ -z .. ].


[info] 336-336: Double quote to prevent globbing and word splitting.


[warning] 355-355: Arrays don't work as operands in [ ]. Use a loop (or concatenate with * instead of @).


[style] 384-384: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 409-409: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[error] 525-525: Argument mixes string and array. Use * or separate argument.


[error] 526-526: Double quote array expansions to avoid re-splitting elements.


[info] 578-578: Double quote to prevent globbing and word splitting.


[info] 580-580: Double quote to prevent globbing and word splitting.


[info] 581-581: Double quote to prevent globbing and word splitting.


[style] 628-628: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[warning] 673-673: This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.


[style] 717-717: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 734-734: Double quote to prevent globbing and word splitting.


[style] 735-735: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 750-750: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 752-752: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 769-769: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.


[style] 771-771: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.


[style] 774-774: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 780-780: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 860-860: Double quote to prevent globbing and word splitting.


[info] 861-861: Double quote to prevent globbing and word splitting.


[info] 862-862: Double quote to prevent globbing and word splitting.


[info] 863-863: Double quote to prevent globbing and word splitting.


[info] 864-864: Double quote to prevent globbing and word splitting.


[info] 865-865: Double quote to prevent globbing and word splitting.


[info] 866-866: Double quote to prevent globbing and word splitting.


[info] 867-867: Double quote to prevent globbing and word splitting.


[info] 868-868: Double quote to prevent globbing and word splitting.


[info] 869-869: Double quote to prevent globbing and word splitting.


[info] 870-870: Double quote to prevent globbing and word splitting.


[info] 875-875: Double quote to prevent globbing and word splitting.


[info] 876-876: Double quote to prevent globbing and word splitting.


[warning] 900-900: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 900-900: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 911-911: See if you can use ${variable//search/replace} instead.


[info] 911-911: Double quote to prevent globbing and word splitting.


[warning] 943-943: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 943-943: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 952-952: Use $(...) notation instead of legacy backticks ....


[style] 960-960: See if you can use ${variable//search/replace} instead.


[info] 960-960: Double quote to prevent globbing and word splitting.


[warning] 981-981: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 981-981: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 989-989: Use $(...) notation instead of legacy backticks ....


[warning] 1012-1012: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 1012-1012: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 1022-1022: Use $(...) notation instead of legacy backticks ....


[info] 1030-1030: Double quote to prevent globbing and word splitting.


[warning] 1048-1048: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 1048-1048: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 1057-1057: Use $(...) notation instead of legacy backticks ....


[info] 1068-1068: Double quote to prevent globbing and word splitting.


[info] 1072-1072: Double quote to prevent globbing and word splitting.


[info] 1073-1073: read without -r will mangle backslashes.


[info] 1073-1073: Double quote to prevent globbing and word splitting.


[warning] 1081-1081: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 1081-1081: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 1091-1091: Use $(...) notation instead of legacy backticks ....


[info] 1099-1099: Double quote to prevent globbing and word splitting.


[info] 1100-1100: Double quote to prevent globbing and word splitting.


[info] 1111-1111: Double quote to prevent globbing and word splitting.


[info] 1115-1115: Double quote to prevent globbing and word splitting.


[info] 1116-1116: read without -r will mangle backslashes.


[info] 1116-1116: Double quote to prevent globbing and word splitting.


[warning] 1124-1124: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 1124-1124: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 1134-1134: Use $(...) notation instead of legacy backticks ....


[info] 1142-1142: Double quote to prevent globbing and word splitting.


[info] 1143-1143: Double quote to prevent globbing and word splitting.


[style] 1189-1189: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 1196-1196: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 1205-1214: Expressions don't expand in single quotes, use double quotes for that.


[style] 1236-1236: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 1240-1240: Double quote to prevent globbing and word splitting.


[style] 1241-1241: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 1256-1256: Double quote to prevent globbing and word splitting.


[style] 1257-1257: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[error] 1287-1287: Double quote array expansions to avoid re-splitting elements.


[style] 1288-1288: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 1295-1295: Double quote to prevent globbing and word splitting.


[info] 1297-1297: Double quote to prevent globbing and word splitting.


[info] 1304-1304: This - will be a regular '-' in this context.


[info] 1304-1304: This : will be a regular ':' in this context.


[info] 1304-1304: This / will be a regular '/' in this context.


[info] 1324-1324: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


[info] 1358-1358: Double quote to prevent globbing and word splitting.


[info] 1455-1455: Double quote to prevent globbing and word splitting.


[info] 1457-1457: Double quote to prevent globbing and word splitting.


[info] 1461-1461: Possible misspelling: DBMS may not be assigned. Did you mean dbms?


[info] 1471-1471: Double quote to prevent globbing and word splitting.


[info] 1472-1472: Double quote to prevent globbing and word splitting.

centreon/unattended.sh Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between d880c0a and 65ae7e5.
Files selected for processing (1)
  • centreon/unattended.sh (1 hunks)
Additional Context Used
ShellCheck (114)
centreon/unattended.sh (114)

[info] 11-11: Double quote to prevent globbing and word splitting.


[info] 39-39: Double quote to prevent globbing and word splitting.


[info] 41-41: Double quote to prevent globbing and word splitting.


[warning] 43-43: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.


[style] 43-43: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 49-49: Double quote to prevent globbing and word splitting.


[warning] 53-53: CENTREON_RELEASE_VERSION appears unused. Verify use (or export if used externally).


[warning] 128-128: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.


[info] 175-175: Double quote to prevent globbing and word splitting.


[info] 200-200: Double quote to prevent globbing and word splitting.


[warning] 209-209: The surrounding quotes actually unquote this. Remove or escape them.


[info] 209-209: Double quote to prevent globbing and word splitting.


[info] 211-211: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


[info] 216-216: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


[warning] 220-220: The surrounding quotes actually unquote this. Remove or escape them.


[info] 220-220: Double quote to prevent globbing and word splitting.


[info] 222-222: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


[error] 263-263: -n doesn't work with unquoted arguments. Quote or use [[ ]].


[info] 263-263: Double quote to prevent globbing and word splitting.


[info] 266-266: read without -r will mangle backslashes.


[info] 266-266: Double quote to prevent globbing and word splitting.


[style] 336-336: Use [ -n .. ] instead of ! [ -z .. ].


[info] 336-336: Double quote to prevent globbing and word splitting.


[warning] 355-355: Arrays don't work as operands in [ ]. Use a loop (or concatenate with * instead of @).


[style] 384-384: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 409-409: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[error] 525-525: Argument mixes string and array. Use * or separate argument.


[error] 526-526: Double quote array expansions to avoid re-splitting elements.


[info] 578-578: Double quote to prevent globbing and word splitting.


[info] 580-580: Double quote to prevent globbing and word splitting.


[info] 581-581: Double quote to prevent globbing and word splitting.


[style] 628-628: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[warning] 673-673: This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.


[style] 717-717: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 734-734: Double quote to prevent globbing and word splitting.


[style] 735-735: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 750-750: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 752-752: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 769-769: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.


[style] 771-771: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.


[style] 774-774: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 780-780: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 860-860: Double quote to prevent globbing and word splitting.


[info] 861-861: Double quote to prevent globbing and word splitting.


[info] 862-862: Double quote to prevent globbing and word splitting.


[info] 863-863: Double quote to prevent globbing and word splitting.


[info] 864-864: Double quote to prevent globbing and word splitting.


[info] 865-865: Double quote to prevent globbing and word splitting.


[info] 866-866: Double quote to prevent globbing and word splitting.


[info] 867-867: Double quote to prevent globbing and word splitting.


[info] 868-868: Double quote to prevent globbing and word splitting.


[info] 869-869: Double quote to prevent globbing and word splitting.


[info] 870-870: Double quote to prevent globbing and word splitting.


[info] 875-875: Double quote to prevent globbing and word splitting.


[info] 876-876: Double quote to prevent globbing and word splitting.


[warning] 900-900: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 900-900: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 911-911: See if you can use ${variable//search/replace} instead.


[info] 911-911: Double quote to prevent globbing and word splitting.


[warning] 943-943: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 943-943: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 952-952: Use $(...) notation instead of legacy backticks ....


[style] 960-960: See if you can use ${variable//search/replace} instead.


[info] 960-960: Double quote to prevent globbing and word splitting.


[warning] 981-981: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 981-981: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 989-989: Use $(...) notation instead of legacy backticks ....


[warning] 1012-1012: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 1012-1012: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 1022-1022: Use $(...) notation instead of legacy backticks ....


[info] 1030-1030: Double quote to prevent globbing and word splitting.


[warning] 1048-1048: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 1048-1048: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 1057-1057: Use $(...) notation instead of legacy backticks ....


[info] 1068-1068: Double quote to prevent globbing and word splitting.


[info] 1072-1072: Double quote to prevent globbing and word splitting.


[info] 1073-1073: read without -r will mangle backslashes.


[info] 1073-1073: Double quote to prevent globbing and word splitting.


[warning] 1081-1081: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 1081-1081: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 1091-1091: Use $(...) notation instead of legacy backticks ....


[info] 1099-1099: Double quote to prevent globbing and word splitting.


[info] 1100-1100: Double quote to prevent globbing and word splitting.


[info] 1111-1111: Double quote to prevent globbing and word splitting.


[info] 1115-1115: Double quote to prevent globbing and word splitting.


[info] 1116-1116: read without -r will mangle backslashes.


[info] 1116-1116: Double quote to prevent globbing and word splitting.


[warning] 1124-1124: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 1124-1124: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 1134-1134: Use $(...) notation instead of legacy backticks ....


[info] 1142-1142: Double quote to prevent globbing and word splitting.


[info] 1143-1143: Double quote to prevent globbing and word splitting.


[style] 1189-1189: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 1196-1196: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 1205-1214: Expressions don't expand in single quotes, use double quotes for that.


[style] 1236-1236: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 1240-1240: Double quote to prevent globbing and word splitting.


[style] 1241-1241: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 1256-1256: Double quote to prevent globbing and word splitting.


[style] 1257-1257: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[error] 1287-1287: Double quote array expansions to avoid re-splitting elements.


[style] 1288-1288: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 1295-1295: Double quote to prevent globbing and word splitting.


[info] 1297-1297: Double quote to prevent globbing and word splitting.


[info] 1304-1304: This - will be a regular '-' in this context.


[info] 1304-1304: This : will be a regular ':' in this context.


[info] 1304-1304: This / will be a regular '/' in this context.


[info] 1324-1324: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


[info] 1358-1358: Double quote to prevent globbing and word splitting.


[info] 1455-1455: Double quote to prevent globbing and word splitting.


[info] 1457-1457: Double quote to prevent globbing and word splitting.


[info] 1461-1461: Possible misspelling: DBMS may not be assigned. Did you mean dbms?


[info] 1471-1471: Double quote to prevent globbing and word splitting.


[info] 1472-1472: Double quote to prevent globbing and word splitting.

Additional comments not posted (1)
centreon/unattended.sh (1)

1176-1176: Refactor the version comparison logic for clarity and maintainability.

- if [[ "$version" =~ ^24\.0[1-9]$ || "$version" =~ ^24\.1[0-2]$ ]]; then
+ if [[ "$version" =~ ^24\.0[1-9]$|^24\.1[0-2]$ ]]; then

This change simplifies the regex by combining the conditions, making it easier to read and maintain.

@centreon centreon deleted a comment from coderabbitai bot May 21, 2024
Copy link
Contributor

coderabbitai bot commented May 22, 2024

Walkthrough

The install_central() function in the unattended.sh script has been updated to refine the version comparison logic for Centreon installations. The regex pattern matching for versions 24.01 to 24.12 is now more precise by using ^ and $ anchors. This change simplifies and ensures accurate version matching during the installation process.

Changes

File(s) Change Summary
centreon/unattended.sh Simplified regex pattern matching for Centreon versions 24.01 to 24.12 using ^ and $ anchors.

🐇
In scripts we trust, to match with might,
Anchors hold the versions tight.
Regex refined, the code does gleam,
Centreon installs like a dream.
Hoppity hop, through lines we weave,
Precision gained, no need to grieve.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range and nitpick comments (3)
centreon/unattended.sh (3)

Line range hint 128-128: Ensure arrays are correctly handled when assigning to a string.

- CENTREON_REPO=""
+ declare -a CENTREON_REPO=()

Line range hint 263-263: Quote the variable to prevent word splitting and globbing issues.

- if [ -n $2 ]; then
+ if [ -n "$2" ]; then

Line range hint 266-266: Use the -r option with read to prevent backslashes from being interpreted.

- read -t $timeout -s -n 1 -p "${1}"
+ read -r -t $timeout -s -n 1 -p "${1}"
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between c9e3a73 and 32dfe70.
Files selected for processing (1)
  • centreon/unattended.sh (1 hunks)
Additional Context Used
ShellCheck (114)
centreon/unattended.sh (114)

[info] 11-11: Double quote to prevent globbing and word splitting.


[info] 39-39: Double quote to prevent globbing and word splitting.


[info] 41-41: Double quote to prevent globbing and word splitting.


[warning] 43-43: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.


[style] 43-43: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 49-49: Double quote to prevent globbing and word splitting.


[warning] 53-53: CENTREON_RELEASE_VERSION appears unused. Verify use (or export if used externally).


[warning] 128-128: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.


[info] 175-175: Double quote to prevent globbing and word splitting.


[info] 200-200: Double quote to prevent globbing and word splitting.


[warning] 209-209: The surrounding quotes actually unquote this. Remove or escape them.


[info] 209-209: Double quote to prevent globbing and word splitting.


[info] 211-211: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


[info] 216-216: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


[warning] 220-220: The surrounding quotes actually unquote this. Remove or escape them.


[info] 220-220: Double quote to prevent globbing and word splitting.


[info] 222-222: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


[error] 263-263: -n doesn't work with unquoted arguments. Quote or use [[ ]].


[info] 263-263: Double quote to prevent globbing and word splitting.


[info] 266-266: read without -r will mangle backslashes.


[info] 266-266: Double quote to prevent globbing and word splitting.


[style] 336-336: Use [ -n .. ] instead of ! [ -z .. ].


[info] 336-336: Double quote to prevent globbing and word splitting.


[warning] 355-355: Arrays don't work as operands in [ ]. Use a loop (or concatenate with * instead of @).


[style] 384-384: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 409-409: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[error] 525-525: Argument mixes string and array. Use * or separate argument.


[error] 526-526: Double quote array expansions to avoid re-splitting elements.


[info] 578-578: Double quote to prevent globbing and word splitting.


[info] 580-580: Double quote to prevent globbing and word splitting.


[info] 581-581: Double quote to prevent globbing and word splitting.


[style] 628-628: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[warning] 673-673: This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.


[style] 717-717: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 734-734: Double quote to prevent globbing and word splitting.


[style] 735-735: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 750-750: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 752-752: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 769-769: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.


[style] 771-771: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.


[style] 774-774: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 780-780: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 860-860: Double quote to prevent globbing and word splitting.


[info] 861-861: Double quote to prevent globbing and word splitting.


[info] 862-862: Double quote to prevent globbing and word splitting.


[info] 863-863: Double quote to prevent globbing and word splitting.


[info] 864-864: Double quote to prevent globbing and word splitting.


[info] 865-865: Double quote to prevent globbing and word splitting.


[info] 866-866: Double quote to prevent globbing and word splitting.


[info] 867-867: Double quote to prevent globbing and word splitting.


[info] 868-868: Double quote to prevent globbing and word splitting.


[info] 869-869: Double quote to prevent globbing and word splitting.


[info] 870-870: Double quote to prevent globbing and word splitting.


[info] 875-875: Double quote to prevent globbing and word splitting.


[info] 876-876: Double quote to prevent globbing and word splitting.


[warning] 900-900: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 900-900: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 911-911: See if you can use ${variable//search/replace} instead.


[info] 911-911: Double quote to prevent globbing and word splitting.


[warning] 943-943: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 943-943: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 952-952: Use $(...) notation instead of legacy backticks ....


[style] 960-960: See if you can use ${variable//search/replace} instead.


[info] 960-960: Double quote to prevent globbing and word splitting.


[warning] 981-981: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 981-981: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 989-989: Use $(...) notation instead of legacy backticks ....


[warning] 1012-1012: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 1012-1012: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 1022-1022: Use $(...) notation instead of legacy backticks ....


[info] 1030-1030: Double quote to prevent globbing and word splitting.


[warning] 1048-1048: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 1048-1048: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 1057-1057: Use $(...) notation instead of legacy backticks ....


[info] 1068-1068: Double quote to prevent globbing and word splitting.


[info] 1072-1072: Double quote to prevent globbing and word splitting.


[info] 1073-1073: read without -r will mangle backslashes.


[info] 1073-1073: Double quote to prevent globbing and word splitting.


[warning] 1081-1081: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 1081-1081: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 1091-1091: Use $(...) notation instead of legacy backticks ....


[info] 1099-1099: Double quote to prevent globbing and word splitting.


[info] 1100-1100: Double quote to prevent globbing and word splitting.


[info] 1111-1111: Double quote to prevent globbing and word splitting.


[info] 1115-1115: Double quote to prevent globbing and word splitting.


[info] 1116-1116: read without -r will mangle backslashes.


[info] 1116-1116: Double quote to prevent globbing and word splitting.


[warning] 1124-1124: This { is literal. Check expression (missing ;/\n?) or quote it.


[warning] 1124-1124: This } is literal. Check expression (missing ;/\n?) or quote it.


[style] 1134-1134: Use $(...) notation instead of legacy backticks ....


[info] 1142-1142: Double quote to prevent globbing and word splitting.


[info] 1143-1143: Double quote to prevent globbing and word splitting.


[style] 1189-1189: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[style] 1196-1196: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 1205-1214: Expressions don't expand in single quotes, use double quotes for that.


[style] 1236-1236: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 1240-1240: Double quote to prevent globbing and word splitting.


[style] 1241-1241: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 1256-1256: Double quote to prevent globbing and word splitting.


[style] 1257-1257: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[error] 1287-1287: Double quote array expansions to avoid re-splitting elements.


[style] 1288-1288: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.


[info] 1295-1295: Double quote to prevent globbing and word splitting.


[info] 1297-1297: Double quote to prevent globbing and word splitting.


[info] 1304-1304: This - will be a regular '-' in this context.


[info] 1304-1304: This : will be a regular ':' in this context.


[info] 1304-1304: This / will be a regular '/' in this context.


[info] 1324-1324: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


[info] 1358-1358: Double quote to prevent globbing and word splitting.


[info] 1455-1455: Double quote to prevent globbing and word splitting.


[info] 1457-1457: Double quote to prevent globbing and word splitting.


[info] 1461-1461: Possible misspelling: DBMS may not be assigned. Did you mean dbms?


[info] 1471-1471: Double quote to prevent globbing and word splitting.


[info] 1472-1472: Double quote to prevent globbing and word splitting.

Additional comments not posted (1)
centreon/unattended.sh (1)

1176-1176: Refactor the version comparison logic for clarity and maintainability.

centreon/unattended.sh Show resolved Hide resolved
@mushroomempires mushroomempires merged commit ad0fd66 into develop May 23, 2024
8 of 9 checks passed
@mushroomempires mushroomempires deleted the MON-fix-unattended branch May 23, 2024 09:22
tuntoja pushed a commit that referenced this pull request Jun 12, 2024
…ion (#4139)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants