Fix curl|bash install: redirect stdin from /dev/tty for interactive prompts
When piped (curl | bash), stdin is the curl output, not the terminal. All read prompts in config.sh were reading leftover pipe data or EOF, causing infinite password validation loops and garbage domain values. Bunker Admin
This commit is contained in:
@@ -224,7 +224,13 @@ echo ""
|
||||
echo -e "${BOLD}Starting configuration wizard...${NC}"
|
||||
echo ""
|
||||
cd "$INSTALL_DIR"
|
||||
bash config.sh
|
||||
# Redirect stdin from terminal — when piped (curl | bash), stdin is the pipe,
|
||||
# so interactive prompts in config.sh would read garbage instead of user input.
|
||||
if [[ -e /dev/tty ]]; then
|
||||
bash config.sh </dev/tty
|
||||
else
|
||||
bash config.sh
|
||||
fi
|
||||
CONFIG_COMPLETE=true
|
||||
|
||||
# =============================================================================
|
||||
@@ -239,6 +245,9 @@ START_SERVICES="y"
|
||||
if [[ -t 0 ]]; then
|
||||
read -rp "Start all services now? [Y/n]: " START_SERVICES
|
||||
START_SERVICES=${START_SERVICES:-y}
|
||||
elif [[ -e /dev/tty ]]; then
|
||||
read -rp "Start all services now? [Y/n]: " START_SERVICES </dev/tty
|
||||
START_SERVICES=${START_SERVICES:-y}
|
||||
fi
|
||||
|
||||
if [[ "$START_SERVICES" =~ ^[Yy]$ ]]; then
|
||||
|
||||
Reference in New Issue
Block a user