fix: add || true to all read commands, disable pipefail during detect_defaults

This commit is contained in:
Claus Lohmar 2026-07-24 09:53:38 +00:00
parent c7cd5550bc
commit e14164921c

View file

@ -139,29 +139,33 @@ prompt_config() {
echo -e "${BOLD}─────────────────────────────────────────${NC}"
echo ""
# Disable strict error handling during detection + prompts
# (ip route may fail, read may hit EOF without TTY)
set +eo pipefail
detect_defaults
set -eo pipefail
# Network interface
read -p " Network interface [$IFACE_DEFAULT]: " IFACE
read -rp " Network interface [$IFACE_DEFAULT]: " IFACE || true
IFACE="${IFACE:-$IFACE_DEFAULT}"
# DHCP range
echo ""
echo " DHCP IP Range"
read -p " Start IP [10.2.0.100]: " RANGE_START
read -rp " Start IP [10.2.0.100]: " RANGE_START || true
RANGE_START="${RANGE_START:-10.2.0.100}"
read -p " End IP [10.2.0.150]: " RANGE_END
read -rp " End IP [10.2.0.150]: " RANGE_END || true
RANGE_END="${RANGE_END:-10.2.0.150}"
read -p " Subnet mask [255.255.255.0]: " NETMASK
read -rp " Subnet mask [255.255.255.0]: " NETMASK || true
NETMASK="${NETMASK:-255.255.255.0}"
read -p " Lease time [12h]: " LEASE_TIME
read -rp " Lease time [12h]: " LEASE_TIME || true
LEASE_TIME="${LEASE_TIME:-12h}"
# Gateway & DNS
echo ""
read -p " Gateway IP [$GATEWAY_DEFAULT]: " GATEWAY_IP
read -rp " Gateway IP [$GATEWAY_DEFAULT]: " GATEWAY_IP || true
GATEWAY_IP="${GATEWAY_IP:-$GATEWAY_DEFAULT}"
read -p " DNS servers (comma-separated) [$DNS_DEFAULT]: " DNS_SERVERS
read -rp " DNS servers (comma-separated) [$DNS_DEFAULT]: " DNS_SERVERS || true
DNS_SERVERS="${DNS_SERVERS:-$DNS_DEFAULT}"
# Save for reference
@ -336,7 +340,7 @@ detect_zoraxy() {
if [ -z "$ZORAXY_CONF_DIR" ]; then
warn "Could not detect Zoraxy config mount in container."
warn "You may need to manually configure the plugin path."
read -rp " Enter Zoraxy conf directory on host: " ZORAXY_CONF_DIR
read -rp " Enter Zoraxy conf directory on host: " ZORAXY_CONF_DIR || true
fi
return 0
@ -373,7 +377,7 @@ detect_zoraxy() {
local choice
while true; do
read -rp " Choose [1]: " choice
read -rp " Choose [1]: " choice || true
choice="${choice:-1}"
case "$choice" in
1)
@ -385,8 +389,8 @@ detect_zoraxy() {
;;
2)
ZORAXY_MODE="custom"
read -rp " Zoraxy conf directory: " ZORAXY_CONF_DIR
read -rp " Zoraxy plugins directory: " ZORAXY_PLUGIN_DIR
read -rp " Zoraxy conf directory: " ZORAXY_CONF_DIR || true
read -rp " Zoraxy plugins directory: " ZORAXY_PLUGIN_DIR || true
break
;;
3)