Linux installer script hotfix for determining os, verifies tar is installed, and fixes logic error in wget url testing.#149
Conversation
…ck if tar is installed, and fixes a logic error in how wget tests urls.
📝 WalkthroughWalkthroughUpdated kernel requirement validation to accept version 4.18 for RHEL-compatible distributions by parsing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Bash/linux/huntress-linux-install.sh (1)
165-176:⚠️ Potential issue | 🟠 MajorRHEL-compatible distros list incomplete—inconsistent with terminology.
The
allowed_418array only checks forID=rhelandID=cloudlinux, but the function comment and error message state "RHEL-compatible distros"—a term conventionally encompassing Rocky, AlmaLinux, CentOS, and Oracle Linux. Systems on these distributions will incorrectly fail the kernel check even if they meet the 4.18+ requirement. Either clarify the comment/message to match the limited list, or expand the allowed ID check to include other RHEL-compatible distros and their correspondingID_LIKEentries.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Bash/linux/huntress-linux-install.sh` around lines 165 - 176, The kernel check in version_check uses a narrow allowed_418 list that only contains "rhel" and "cloudlinux" (allowed_418) and reads os_release_id from /etc/os-release, which will cause Rocky/AlmaLinux/CentOS/Oracle to be treated as non-RHEL-compatible; update version_check to either expand allowed_418 to include "rocky almalinux centos oracle" and/or parse ID_LIKE (os_release_id and os_release_id_like) so RHEL-compatible IDs are recognized, or alternatively change the comment/error message to explicitly say only RHEL and CloudLinux are supported; adjust the logic where allowed_418 is referenced and keep the function name version_check and the os_release_id variable intact so callers remain unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@Bash/linux/huntress-linux-install.sh`:
- Around line 165-176: The kernel check in version_check uses a narrow
allowed_418 list that only contains "rhel" and "cloudlinux" (allowed_418) and
reads os_release_id from /etc/os-release, which will cause
Rocky/AlmaLinux/CentOS/Oracle to be treated as non-RHEL-compatible; update
version_check to either expand allowed_418 to include "rocky almalinux centos
oracle" and/or parse ID_LIKE (os_release_id and os_release_id_like) so
RHEL-compatible IDs are recognized, or alternatively change the comment/error
message to explicitly say only RHEL and CloudLinux are supported; adjust the
logic where allowed_418 is referenced and keep the function name version_check
and the os_release_id variable intact so callers remain unchanged.
This commit fixes an issue with parsing the Linux OS type, adds a check if tar is installed, and fixes a logic error in how wget tests urls. These changes were successfully tested against CloudLinux 8.10 and Ubuntu 24.04.
Summary by CodeRabbit
Bug Fixes
Improvements