From 7c7c920f5e3c727d97cd94cd4d86cfd7a64f6030 Mon Sep 17 00:00:00 2001 From: cclohmar Date: Thu, 6 Aug 2026 14:18:16 +0100 Subject: [PATCH] fix: one-liner reads from /dev/tty for interactive prompt, README explains both methods --- README.md | 8 +++++++- setup.sh | 10 ++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 44942b7..1f6ad58 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,13 @@ This project was built with the help of AI — designed through conversation, re curl -sSL https://git.lohmar.co.uk/cclohmar/NextNVR/raw/branch/main/setup.sh | bash ``` -That's it. The script installs everything and starts NextNVR automatically. +The script will ask where to store recordings. Press Enter for the default (`~/nvr_data`) or type your own path (e.g. `/mnt/recordings`). + +**Want to pre-set the storage path without being asked?** + +```bash +STORAGE_PATH=/mnt/recordings curl -sSL https://...setup.sh | bash +``` --- diff --git a/setup.sh b/setup.sh index 6d5e5ca..b09e0e1 100755 --- a/setup.sh +++ b/setup.sh @@ -152,15 +152,13 @@ info " Or set STORAGE_PATH environment variable to skip the prompt." echo "" if [ -n "${STORAGE_PATH}" ]; then log "Using STORAGE_PATH from environment: ${STORAGE_PATH}" -elif [ -t 0 ]; then - # Interactive terminal — ask the user. - read -p " Storage path [${HOME}/nvr_data]: " STORAGE_PATH +elif [ -e /dev/tty ]; then + read -p " Storage path [${HOME}/nvr_data]: " STORAGE_PATH