From 623b7ee51f5cfe228c5f99b42e9daddb0f3a1c1e Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Tue, 25 Mar 2025 13:15:48 +0000 Subject: [PATCH] fix(installer): Improve installation instructions for interactive and non-interactive setups --- changelog.md | 6 ++++++ install.sh | 6 ++++-- readme.md | 20 ++++++++++++-------- ts/00_commitinfo_data.ts | 2 +- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/changelog.md b/changelog.md index 645bcda..36fcf24 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2025-03-25 - 2.4.6 - fix(installer) +Improve installation instructions for interactive and non-interactive setups + +- Changed install.sh to require explicit download of the install script and updated error messages for non-interactive modes +- Updated readme.md to include three distinct installation methods with clear command examples + ## 2025-03-25 - 2.4.5 - fix(install) Improve interactive terminal detection and update installation instructions diff --git a/install.sh b/install.sh index 8056c5f..22a6695 100644 --- a/install.sh +++ b/install.sh @@ -74,9 +74,11 @@ if [ ! -t 0 ] || [ ! -t 1 ]; then if [ $INTERACTIVE -eq 0 ]; then echo "ERROR: No controlling terminal available for interactive prompts." echo "For interactive installation (RECOMMENDED):" - echo " sudo bash <(curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh)" + echo " curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh -o nupst-install.sh" + echo " sudo bash nupst-install.sh" + echo "" echo "For non-interactive installation with automatic dependency installation:" - echo " sudo bash <(curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh) -y" + echo " curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh | sudo bash -s -- -y" exit 1 else echo "Interactive terminal found, continuing with prompts..." diff --git a/readme.md b/readme.md index 1a4d0c1..00949b8 100644 --- a/readme.md +++ b/readme.md @@ -19,18 +19,22 @@ NUPST is a command-line tool that monitors SNMP-enabled UPS devices and initiate ### Quick Install (One-line command) ```bash -# RECOMMENDED: Install interactively using process substitution (requires root privileges) -# This ensures proper interactive prompts for dependencies -sudo bash <(curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh) +# Method 1: Download and run (most reliable across all environments) +curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh -o nupst-install.sh +sudo bash nupst-install.sh +``` -# Alternative: Install with auto-yes for dependencies (will install git automatically if needed) -# Use this for automated/non-interactive installations -sudo bash <(curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh) -y - -# For systems where process substitution is not available (e.g., some older shells) +```bash +# Method 2: Pipe with automatic yes for dependencies (non-interactive) curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh | sudo bash -s -- -y ``` +```bash +# Method 3: Process substitution (only on systems that support /dev/fd/) +# Note: This may fail on some systems with "No such file or directory" errors +sudo bash <(curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh) +``` + ### Direct from Git ```bash diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 5559faa..453746a 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/nupst', - version: '2.4.5', + version: '2.4.6', description: 'Node.js UPS Shutdown Tool for SNMP-enabled UPS devices' }