Skip to content

Commit 50ea2a3

Browse files
feat: add zsh shell detection to install script (#1539)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Installer now detects when the environment is using Zsh and halts with clear error messages and guidance so users can move Zsh configuration to interactive-only files. * **Bug Fixes** * Prevents running the installer under unsupported shell setups, improving installation reliability and avoiding misconfigured runs. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent b518131 commit 50ea2a3

File tree

1 file changed

+27
-0
lines changed
  • plugin/source/dynamix.unraid.net/usr/local/share/dynamix.unraid.net/install/scripts

1 file changed

+27
-0
lines changed

plugin/source/dynamix.unraid.net/usr/local/share/dynamix.unraid.net/install/scripts/verify_install.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22
# Unraid API Installation Verification Script
33
# Checks that critical files are installed correctly
44

5+
# Function to check for non-bash shells
6+
check_shell() {
7+
# This script runs with #!/bin/bash shebang
8+
# On Unraid, users may configure bash to load other shells through .bashrc
9+
# We check if the current process ($$) is actually bash, not another shell
10+
# Using $$ is correct here - we need to detect if THIS process is running the expected bash
11+
local current_shell
12+
current_shell=$(ps -o comm= -p $$)
13+
14+
# Remove any path and get just the shell name
15+
current_shell=$(basename "$current_shell")
16+
17+
if [[ "$current_shell" != "bash" ]]; then
18+
echo "Unsupported shell detected: $current_shell" >&2
19+
echo "Unraid scripts require bash but your system is configured to use $current_shell for scripts." >&2
20+
echo "This can cause infinite loops or unexpected behavior when Unraid scripts execute." >&2
21+
echo "Please configure $current_shell to only activate for interactive shells." >&2
22+
echo "Add this check to your ~/.bashrc or /etc/profile before starting $current_shell:" >&2
23+
echo " [[ \$- == *i* ]] && exec $current_shell" >&2
24+
echo "This ensures $current_shell only starts for interactive sessions, not scripts." >&2
25+
exit 1
26+
fi
27+
}
28+
29+
# Run shell check first
30+
check_shell
31+
532
echo "Performing comprehensive installation verification..."
633

734
# Define critical files to check (POSIX-compliant, no arrays)

0 commit comments

Comments
 (0)