mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-24 12:13:28 +00:00
fix: handle piped script execution for Proxmox container installs
When script is piped through curl, download a fresh copy to push to the container instead of trying to use $0 which would be 'bash'
This commit is contained in:
+19
-1
@@ -511,12 +511,30 @@ EOF
|
||||
# Install Pulse inside container
|
||||
print_info "Installing Pulse..."
|
||||
|
||||
# When piped through curl, $0 is "bash" not the script. Download fresh copy.
|
||||
local script_source="/tmp/pulse_install_$$.sh"
|
||||
if [[ "$0" == "bash" ]] || [[ ! -f "$0" ]]; then
|
||||
# We're being piped, download the script
|
||||
if ! curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh > "$script_source" 2>/dev/null; then
|
||||
print_error "Failed to download install script"
|
||||
cleanup_on_error
|
||||
fi
|
||||
else
|
||||
# We have a local script file
|
||||
script_source="$0"
|
||||
fi
|
||||
|
||||
# Copy this script to container and run it
|
||||
if ! pct push $CTID $0 /tmp/install.sh >/dev/null 2>&1; then
|
||||
if ! pct push $CTID "$script_source" /tmp/install.sh >/dev/null 2>&1; then
|
||||
print_error "Failed to copy install script to container"
|
||||
cleanup_on_error
|
||||
fi
|
||||
|
||||
# Clean up temp file if we created one
|
||||
if [[ "$script_source" == "/tmp/pulse_install_"* ]]; then
|
||||
rm -f "$script_source"
|
||||
fi
|
||||
|
||||
# Run installation quietly (suppress verbose output) with port configuration
|
||||
local install_cmd="bash /tmp/install.sh --in-container"
|
||||
if [[ "$frontend_port" != "7655" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user