Fix installer exit when WEB_USER not found in config
grep returns exit 1 when no match, which with set -eo pipefail kills the script. Add || true to the grep pipeline in credential extraction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -164,7 +164,7 @@ enable_web="n"
|
||||
read -rp "Enable web dashboard (TUI in browser)? (y/n) [n]: " enable_web </dev/tty || true
|
||||
if [ "$enable_web" = "y" ] || [ "$enable_web" = "Y" ]; then
|
||||
# Set up web credentials
|
||||
web_user="$(grep '^WEB_USER=' "$CONFIG_DIR/gniza.conf" 2>/dev/null | sed 's/^WEB_USER="//' | sed 's/"$//')"
|
||||
web_user="$(grep '^WEB_USER=' "$CONFIG_DIR/gniza.conf" 2>/dev/null | sed 's/^WEB_USER="//' | sed 's/"$//' || true)"
|
||||
web_user="${web_user:-admin}"
|
||||
api_key="$(python3 -c 'import secrets; print(secrets.token_urlsafe(32))')"
|
||||
if grep -q "^WEB_USER=" "$CONFIG_DIR/gniza.conf" 2>/dev/null; then
|
||||
|
||||
Reference in New Issue
Block a user